Handling a single schema.sql #2134
Unanswered
erickhouse
asked this question in
Q&A
Replies: 1 comment
-
Hey @erickhouse 👋 The desired state can be defined as a schema directory, which is a list of files executed in lexicographical order. The only restriction is that it must contain an atlas.sum file; hence, the directory will be managed as a migration directory. Please give this a try and let me know if you need any help with it. ➜ example echo 'create table t1(c int);' > schema/1.sql
➜ example echo 'create table t2(c int);' > schema/2.sql
➜ example atlas migrate hash --dir file://schema
➜ example atlas schema apply \
--to file://schema \
--dev-url "sqlite://dev?mode=memory" \
--url sqlite://file.db
-- Planned Changes:
-- Create "t1" table
CREATE TABLE `t1` (`c` int NULL);
-- Create "t2" table
CREATE TABLE `t2` (`c` int NULL);
✔ Apply |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi.
The atlas API expects a single schema.sql file when generating migrations (
atlas migrate diff
) . How are people developing against this API restriction?My assumption is that there's an expected pre-processing step to generate a single schema.sql file. What tools are people using to handle this step?
Beta Was this translation helpful? Give feedback.
All reactions