-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to "synchronize" multiple schemas in the same database? And about diff. #53
Comments
1: The exact solution will depend on your overall db topology, but generally this can be solved by moving the schema name to an environment-section of the .skeema file. How many production schemas do you have? If just one, I recommend starting your repo using
Then you can specify environment names on the CLI to interact with the right thing: Any configuration placed above the first environment (above the "[production]" line in the example here) applies to all environments, but individual environments may still override these as needed. There's a longer example in the examples doc. If you have multiple different logical production schemas -- perhaps representing storage for different microservices -- the same general method of "move the schema name to an environment section" still applies. The overall setup may be a bit trickier in this case though, since you can't use a single flat directory hierarchy with multiple logical schemas, so the host names need to be configured one directory level up. If your dev/test locations don't follow the same colocation pattern as prod, this can get messy, but may still be solvable with some combination of host-level ignore-schema and/or skip-new-schemas. 2: This is explained in the docs for allow-unsafe and also mentioned in passing in the FAQ. Please let me know if this doesn't make sense though, I can improve the docs in this area if it still seems unclear/confusing. Thanks! |
Thanks for the help! |
1: Yes, the default layout created by If you don't use If you do use In any case, you can freely move things around in the .skeema files. Everyone uses a different database topology, and Skeema attempts to be flexible enough to support any arbitrary layout. But the cost of this is it can sometimes be complex to configure. 2: Just for context, this functionality was largely derived from trial and error. Very early on, |
I have 2 schemas in my local database. One is used for development and the other to run automatic tests (they have different names). How should I go about using skeema on both of them (since I can't use
--schema
ondiff
command; in fact the schema is "hardcoded" in a file).What is the reasoning behind having 2 different commands (
diff
andpush
), where one is destructive (push
) and another is not (diff
), but you still have to use theallow-unsafe
option if you just want to use the non-destructive one?The text was updated successfully, but these errors were encountered: