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

Make Gemini create its own DB tables #722

Closed
jonathangreen opened this issue Sep 22, 2017 · 9 comments
Closed

Make Gemini create its own DB tables #722

jonathangreen opened this issue Sep 22, 2017 · 9 comments

Comments

@jonathangreen
Copy link
Contributor

For the most part when I'm installing a web app, I expect to be able to point it at an empty DB, and it till do what it needs and create its own tables. This is not the case with Gemini, and it makes supporting Postgres and MySQL difficult, and makes the playbook to install longer then I think it needs to be.

I'd like to see if there is a good way to have Gemini handle the table creation internally.

Thoughts anyone?

@ajs6f
Copy link

ajs6f commented Sep 22, 2017

Both MySQL and Postgres have CREATE IF NOT EXISTS, but I dunno about other dbs.

@dannylamb
Copy link
Contributor

@jonathangreen Composer script to run after deployment?

@jonathangreen
Copy link
Contributor Author

jonathangreen commented Sep 22, 2017

The biggest issue I had was the ID column. Postgres wants SERIAL and MySQL wants AUTOINCREMENT. I was going to see what our database layer has for DB schema support. Maybe we can do something clever within the app.

Eventually we probably want something like schema versions right? If we ever expect the tables to change at all.

@dannylamb
Copy link
Contributor

@jonathangreen DBAL looks like it has cross-db tools for checking and creating tables: http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/schema-manager.html

@jonathangreen
Copy link
Contributor Author

@dannylamb yes! something like that was exactly what I was thinking. How do you feel about gemini managing its schema using schema-manager?

@dannylamb
Copy link
Contributor

👍 Sounds good to me.

@DiegoPino
Copy link
Contributor

DiegoPino commented May 31, 2018

@seth-shaw-unlvI will make https://github.com/Islandora-CLAW/Crayfish/blob/master/Gemini/src/Migrations/Version20180530031926.php#L13 aware of postgres instead of having 2x migration files. Too complicated without access to modify app['db'] directly from Crayfish (part of commons).

Again, something like #828 (comment)

And will integrate into composer.json script section. Wonder if you want this to run on each install or on each update?

Also: I think we need to have an extra "migrate your data if you already have stuff there" option. Probably worth another ticket.

@seth-shaw-unlv
Copy link
Contributor

I've created a new Crayfish branch (https://github.com/Islandora-CLAW/Crayfish/tree/issue-828) with the postgresql changes (took a while to get that right) but I'll hold off on the PR until we have the updated playbook. I'm working on that right now with a local ansible-role-crayfish branch.

I'm trying to get ansible to run composer install and php bin/console migrations:migrate. Hopefully I'll get it working soon.

@seth-shaw-unlv
Copy link
Contributor

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

No branches or pull requests

5 participants