dox_migration 1.0.3  dox_migration: ^1.0.3 copied to clipboard
dox_migration: ^1.0.3 copied to clipboard
Database migration package for Postgres SQL
Dox Migration #
Database migration package for Postgres SQL.
Usage #
Create migration file #
.sql file #
dox_migration create CreateUserTable --sql 
.dart file #
dox_migration create CreateUserTable --dart 
.dartfile required dox query builder
Run migration and rollback #
.env sample #
DB_HOST=localhost
DB_PORT=5432
DB_NAME=dox_example_app
DB_USERNAME=admin
DB_PASSWORD=password
Migrate #
await Migration().migrate();
Rollback #
await Migration().rollback();
Without using .env #
PgEndpoint endPoint = PgEndpoint(
    host: 'localhost',
    port: 5432,
    database: 'postgres',
    username: 'postgres',
    password: 'postgres',
);
await Migration().migrate(endPoint: endPoint);