Skip to content

Instantly share code, notes, and snippets.

View ocemarcus's full-sized avatar

Marcus Antonio ocemarcus

  • Belo Horizonte
View GitHub Profile
@NigelEarle
NigelEarle / Knex-Migrations-Seeding.md
Last active February 17, 2025 18:17
Migration and seeding instructions using Knex.js!

Migrations & Seeding

What are migrations??

Migrations are a way to make database changes or updates, like creating or dropping tables, as well as updating a table with new columns with constraints via generated scripts. We can build these scripts via the command line using knex command line tool.

To learn more about migrations, check out this article on the different types of database migrations!

Creating/Dropping Tables

@rdeavila
rdeavila / pgsql-size.sql
Last active December 4, 2024 20:02
PostgreSQL: Como ver o tamanho das bases de dados de um servidor
-- Para saber o tamanho de todas as bases de dados:
SELECT pg_database.datname, pg_size_pretty(pg_database_size(pg_database.datname)) AS size FROM pg_database;