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

setup script not creating mysql tables #444

Open
betterltn opened this issue Apr 26, 2016 · 8 comments
Open

setup script not creating mysql tables #444

betterltn opened this issue Apr 26, 2016 · 8 comments

Comments

@betterltn
Copy link

collins fails to start with error

... 52 more

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'collins.asset_meta' doesn't exist
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)

mysql credencials are fine .

@byxorna
Copy link
Contributor

byxorna commented Apr 26, 2016

Collins will not run evolutions by default, so you need to create your schema before starting collins up manually (or remember the magic play incantation to try to apply evolutions on startup).

Try something like this in your config, and see if it applies evolutions.

# mysql DB config
evolutionplugin=enabled
applyEvolutions.collins=true
applyDownEvolutions.collins=true

@replicant0wnz
Copy link

FYI,

The above does not exist in the default Docker config .. Took some searching to find this thread.

@william-richard
Copy link
Contributor

william-richard commented May 9, 2016

@replicant0wnz it looks like at least the forward direction is present in the docker config:
https://github.com/tumblr/collins/blob/master/conf/docker/database.conf#L2
https://github.com/tumblr/collins/blob/master/conf/docker/database.conf#L12
And since docker is using the in-memory database, you shouldn't ever be in a situation where you would need to downgrade your schema.

Can you give me some steps to reproduce the error you ran into with docker?

@replicant0wnz
Copy link

Er, sorry. It's not in the following file:

https://github.com/tumblr/collins/blob/master/conf/docker/database.conf.mysql

If you wanted to persist the data and use MySQL I assumed you simply copy that file to database.conf and add your server settings. Unless you add the above evolution items it won't create the schema.

@william-richard
Copy link
Contributor

@replicant0wnz yep - that was an intentional choice. That's because, in general, we find that when people run with mysql, they don't want evolutions to happen automatically. Plus, that file isn't going to work out of the box for anyone since you'll have to modify the db.collins.url to point at your database.

@replicant0wnz
Copy link

Gotcha. So I did modify the file w/the my correct DB config but it would not create the schema unless I turned on evolutions (my original issue). I also didn't see anywhere in the documentation on how to create the schema.

@byxorna
Copy link
Contributor

byxorna commented May 11, 2016

@replicant0wnz if you use the database.conf.mysql with the fields set like so:

evolutionplugin=enabled
applyEvolutions.collins=true
applyDownEvolutions.collins=true

the evolutions will create your schema.

@replicant0wnz
Copy link

@byxorna that's exactly what I did, but due to lack of documentation I had to find out that information from this thread per your earlier reply ;-)

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

4 participants