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

Refactor migration (database is out of date) #1400

Closed
sebgie opened this issue Nov 4, 2013 · 0 comments · Fixed by #1449
Closed

Refactor migration (database is out of date) #1400

sebgie opened this issue Nov 4, 2013 · 0 comments · Fixed by #1449
Assignees
Milestone

Comments

@sebgie
Copy link
Contributor

sebgie commented Nov 4, 2013

depends on #1398 (Create schema.js)

Refactor migration from one database version to another. The changes should be determined by comparing the actual database with the schema.js file. Any changes found should be applied to the database to reflect the new version.

Supported operations:

  • CREATE TABLE
  • DROP TABLE
  • ALTER TABLE
    • ADD COLUMN
    • DROP COLUMN
    • MODIFY COLUMN

Table and column renaming needs some investigation on how to do this.

The same mechanism could be used to generate tables for Apps. An App has to provide its own schema.js file and whenever a new App is activated the database is updated with the new instructions from schema.js.

@sebgie sebgie mentioned this issue Nov 14, 2013
@ghost ghost assigned sebgie Nov 14, 2013
sebgie added a commit to sebgie/Ghost that referenced this issue Nov 18, 2013
closes TryGhost#1398
closes TryGhost#1399
closes TryGhost#1400
- added schema.js with database version '000'
- refactored migration to use schema.js
- if new table is added to schema.js and databaseVersion is increased, table will be added
- if new table is deleted to schema.js and databaseVersion is increased, table will be deleted
- alter table from issue TryGhost#1400 is delayed until knex supports column modification
- changed import pre checks to work again (will be refactored separately)
- added basic PostgreSQL support (Attention: not supported/tested)
- changed error handling in server.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant