Open Vsevosemnog opened 2 years ago
You'll want to look into the migrate up
command to actually apply the migrations - the create
command just creates the files for you to populate
No no no!) I would like to create sql files with content of creation scripts for my database. In order to do it one should use migrate create
migrate up
is used for applying migrations to my db, i don`t need it right now
@EightLegs makes sense - in that case I think you need a different tool as this one is mainly good for creating your schema from scratch, rather than exporting an existing schema into migration scripts :)
I need some help.
Have service_users db there i have service_users schema. I need to make a sql-file migration of this schema
am i doing this right?:
export POSTGRESQL_URL='postgres://postgres:
migrate create -ext sql -seq create_service_users_schema
After these commands the output files are empty.
How should i create migration?
@Vsevosemnog That's an expected behavior. Migration create adds an empty numbered up
and down
files, which you need to fill with actual SQL commands
Describe the Bug I read the tutorial about how to connect and use migrate with my postgresql db. But when i use "migrate create" command migration files are empty
Steps to Reproduce Steps to reproduce the behavior:
Expected Behavior There should be any evidence, that i use migrate program with my db. Any record in postgresql log file, any data in output files. it looks like i`ve not even connected with my db.
Migrate Version e.g. v4.15.2 Obtained by running:
migrate -version
Loaded Source Drivers Source drivers: s3, bitbucket, github-ee, gitlab, go-bindata, godoc-vfs, github, gcs, file
Loaded Database Drivers Database drivers: stub, cassandra, firebird, neo4j, postgres, cockroach, mysql, clickhouse, cockroachdb, crdb-postgres, postgresql, redshift, spanner, sqlserver, firebirdsql, mongodb, mongodb+srv, pgx
Go Version go version go1.19.2 linux/amd6
Stacktrace Please provide if available
Additional context Please, help me to connect to my db with this program