Skip to content
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

Dump the schema to a file once migrations have been run #2

Closed
bradfordcp opened this issue Jan 31, 2015 · 3 comments · Fixed by #8
Closed

Dump the schema to a file once migrations have been run #2

bradfordcp opened this issue Jan 31, 2015 · 3 comments · Fixed by #8
Assignees
Milestone

Comments

@bradfordcp
Copy link
Contributor

Also add a task to load the schema from the dumped export into a clean keyspace.This would save time as migrations wouldn't need to be run when initially setting up the project. Optionally inspect the migrations table to see if the keyspace is in a state to accept the schema load.

Code Path 1: New developer spinning up on project

inv cassandra.create cassandra.load_schema

The keyspace is created and db/schema.cql will be loaded.

Code Path 2: Developer adds a migration

inv cassandra.add_migration --name add_foo_table

developer fills out the new migration file

inv cassandra.migrate

The migration file is run (along with any other migrations that have not run). The db/schema.cql file is replaced with an updated version that contains all CREATE statements that include the new migration.

@bradfordcp bradfordcp self-assigned this Jan 31, 2015
@bradfordcp bradfordcp modified the milestone: 1.0 Jan 31, 2015
@bradfordcp
Copy link
Contributor Author

cqlsh has a command to execute a statement. A simple implementation of this could be DESC KEYSPACE keyspace_name; with the output dumped to a file.

@bradfordcp
Copy link
Contributor Author

Schema dumping logic has been added in 489a8ec. It appears as though loading the schema will be easier if the keyspace doesn't already exists.

@bradfordcp
Copy link
Contributor Author

Feature complete and merged in PR #8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant