Difference between revisions of "Atlas sql migrations"
Jump to navigation
Jump to search
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
https://github.com/ariga/atlas | https://github.com/ariga/atlas | ||
+ | |||
+ | ``` | ||
+ | mkdir migrations | ||
+ | |||
+ | atlas schema inspect --url sqlite://foo.db > migrations/init.hcl | ||
+ | atlas schema diff --to file://migrations --from sqlite://foo.db --dev-url sqlite://foo.db | ||
+ | atlas schema apply --to file://migrations --url sqlite://foo3.db | ||
+ | ``` | ||
+ | |||
``` | ``` | ||
atlas schema inspect --url sqlite://ucms.db --format '{{ sql . }}' | atlas schema inspect --url sqlite://ucms.db --format '{{ sql . }}' | ||
+ | |||
+ | atlas schema diff --to file://migrations --from sqlite://foo.db --dev-url sqlite://foo.db | ||
atlas schema diff --from file://migrations --to sqlite://foo.db --dev-url sqlite://bar.db | atlas schema diff --from file://migrations --to sqlite://foo.db --dev-url sqlite://bar.db | ||
− | `` | + | ``` |
Latest revision as of 01:48, 14 April 2024
https://github.com/ariga/atlas
mkdir migrations atlas schema inspect --url sqlite://foo.db > migrations/init.hcl atlas schema diff --to file://migrations --from sqlite://foo.db --dev-url sqlite://foo.db atlas schema apply --to file://migrations --url sqlite://foo3.db
atlas schema inspect --url sqlite://ucms.db --format '{{ sql . }}' atlas schema diff --to file://migrations --from sqlite://foo.db --dev-url sqlite://foo.db atlas schema diff --from file://migrations --to sqlite://foo.db --dev-url sqlite://bar.db