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

Migrations not supported on CockroachDB #522

Closed
jethrogb opened this Issue Dec 5, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@jethrogb
Contributor

jethrogb commented Dec 5, 2016

When running diesel setup from the getting started example with CockroachDB beta-20161201, I get this error:

thread 'main' panicked at 'Error creating timestamp helper functions for Pg: DatabaseError(__Unknown, "syntax error at or near \"OR\"\nCREATE OR REPLACE FUNCTION diesel_set_updated_at() RETURNS trigger AS $$\n       ^\n")', ../src/libcore/result.rs:788
@sgrif

This comment has been minimized.

Member

sgrif commented Dec 5, 2016

This is because CockroachDB doesn't support stored procedures. We can probably add a skip-timestamp-helpers feature or something and just not generate those functions.

SecurityInsanity added a commit to SecurityInsanity/diesel that referenced this issue Apr 6, 2017

add ability to skip timestamp helpers
fixes diesel-rs#522

this adds the ability to skip timestamp helpers for postgres which
should allow cockroach migrations to pass so you can start running
normal migrations.

sgrif added a commit that referenced this issue Jul 4, 2017

Don't magically set up timestamp helpers, create a migration file
This file is where our initial "plumbing" can go. At the moment we only
provide it for PG, and its only behavior is safe to add to existing
projects.

However, since we're placing this file in other people's projects, and
in a structure where once it's run we can't modify it, we should talk
about how this file will evolve over time if needed. If we ever do need
to add more stuff here, I'd expect this file to just be changed for new
projects. For existing projects, I'm thinking we'd provide a `diesel
update` command which checks a metadata table with the last version
`diesel update` was run against. It will then generate new migrations
(versioned normally, we don't want to affect existing tables) to bring
everything up to speed.

Fixes #522.
Close #848.

sgrif added a commit that referenced this issue Jul 4, 2017

Don't magically set up timestamp helpers, create a migration file
This file is where our initial "plumbing" can go. At the moment we only
provide it for PG, and its only behavior is safe to add to existing
projects.

However, since we're placing this file in other people's projects, and
in a structure where once it's run we can't modify it, we should talk
about how this file will evolve over time if needed. If we ever do need
to add more stuff here, I'd expect this file to just be changed for new
projects. For existing projects, I'm thinking we'd provide a `diesel
update` command which checks a metadata table with the last version
`diesel update` was run against. It will then generate new migrations
(versioned normally, we don't want to affect existing tables) to bring
everything up to speed.

Fixes #522.
Close #848.

@sgrif sgrif closed this in #991 Jul 8, 2017

Fiedzia added a commit to Fiedzia/diesel that referenced this issue Jul 9, 2017

Don't magically set up timestamp helpers, create a migration file
This file is where our initial "plumbing" can go. At the moment we only
provide it for PG, and its only behavior is safe to add to existing
projects.

However, since we're placing this file in other people's projects, and
in a structure where once it's run we can't modify it, we should talk
about how this file will evolve over time if needed. If we ever do need
to add more stuff here, I'd expect this file to just be changed for new
projects. For existing projects, I'm thinking we'd provide a `diesel
update` command which checks a metadata table with the last version
`diesel update` was run against. It will then generate new migrations
(versioned normally, we don't want to affect existing tables) to bring
everything up to speed.

Fixes diesel-rs#522.
Close diesel-rs#848.

Fiedzia added a commit to Fiedzia/diesel that referenced this issue Jul 12, 2017

Don't magically set up timestamp helpers, create a migration file
This file is where our initial "plumbing" can go. At the moment we only
provide it for PG, and its only behavior is safe to add to existing
projects.

However, since we're placing this file in other people's projects, and
in a structure where once it's run we can't modify it, we should talk
about how this file will evolve over time if needed. If we ever do need
to add more stuff here, I'd expect this file to just be changed for new
projects. For existing projects, I'm thinking we'd provide a `diesel
update` command which checks a metadata table with the last version
`diesel update` was run against. It will then generate new migrations
(versioned normally, we don't want to affect existing tables) to bring
everything up to speed.

Fixes diesel-rs#522.
Close diesel-rs#848.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment