Comments (2)
Hey there,
I do the following in our CI tests:
Given I have
schema.sql
file with latest DB schema- and
schema-pre-migration.sql
file matching the DB schema state before the first available migration is run (this is how we clean-up old migrations)
DB schema + Goose migration test:
- DROP database_goose
- CREATE database_goose
psql database_goose < schema-pre-migration.sql
goose up
goose reset
goose up
pg_dump database_goose --schema-only | grep -v -e '^--' -e '^COMMENT ON' -e '^REVOKE' -e '^GRANT' -e '^SET' -e 'ALTER DEFAULT PRIVILEGES' -e 'OWNER TO' | cat -s > schema.sql
git diff
the schema.sql against "latest"schema.sql
that is checked-into our git codebase and error out if it differs
Application tests:
- DROP database_app
- CREATE database_app
psql database_app < schema.sql
- Run application tests against latest schema only
from goose.
solved by removing "\ from command arguments
from goose.
Related Issues (20)
- Need advice and guidance on our case. HOT 3
- Semicolon Detection Fails for "--" in Strings in SQL Statements HOT 3
- Support for quiet operations HOT 4
- Creating two migrations at the same time HOT 1
- New feature `up-preview` `down-preview`? HOT 3
- Request to release 3.18.1 HOT 4
- Question: Is it possible to conditionally run different statements based on type of database? HOT 5
- Build breaks: undefined symbol: duckdb_xx HOT 4
- Feature request: goose seed HOT 4
- failed to insert new goose version: Error 1054 (42S22): Unknown column '$1' in 'field list' HOT 2
- "NO TRANSACTION" migrations should mark database as dirty if not successful HOT 3
- clickhouse: getting a sql.ErrSkip at createVersionTable() HOT 4
- Error when executing SQL migration with specific comments HOT 2
- support for using a custom dialect? HOT 13
- Add support for ssl ca-cert for Postgres HOT 1
- Update README.md
- fail when there is a pending migration and out of order migrations are not allowed HOT 2
- NO TRANSACTION annotation is case sensitive HOT 7
- Feature request: explore WASM-based migrations
- Question about providing our own Logger implementation HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goose.