-
Notifications
You must be signed in to change notification settings - Fork 91
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
Producer args not used when generating SQL diffs #81
Comments
It is the same producer, but it is geared to do things differently based on an option. Please investigate how/why this is not getting populated. Alternatively please write a test (even if as a CLI oneliner) that demonstrates the problem. Thanks! |
|
@ribasushi I narrowed it down to SQL::Translator::Diff, when building an SQL::Translator object in It should be: my $translator = SQL::Translator->new(
producer_type => $self->output_db,
add_drop_table => 0,
no_comments => 1,
producer_args => $self->producer_args
);otherwise the SQL::Translator constructor gets The MySQL producer's With this fix I can get my boolean column. I still have backticks everywhere, which is aesthetically annoying but I can live with that. :) |
|
The problem with changing it to @fgabolde: Can you try changing the |
|
@ilmari I can, but then the regular producer (generating the full schema) loses |
|
@fgabolde D'oh, of course. I think the most backwards-compatible fix would be to change |
|
@ilmari Yeah, that works. It doesn't break any tests in DBIC, which is unsettling, but I get both the full schema and the diff with the right It changes some other things as well because those SQLT args seem tailored for the full DDL and not so much for the diff, so I get no quotes (which I like) and |
This reverts commit 4c146fe. It's going to produce inconsistent results between deploy and upgrade. See dbsrgits/sql-translator#81
|
Honestly, I can't think of a single reason why |
|
Actually, with version 4 it gives boolean as well. So by default SQLT is producing boolean datatype for mysql 3... |
|
hey all, it's a bit late (only 6 years), but I just pushed a patch changing the name of the |
I'm adding a boolean column to an existing table and creating a different table with a boolean column:
and generating the DDL via DBIx::Class:
The full schema is correctly generated, both tables have "flagged_for_deletion boolean NOT NULL DEFAULT '0'" which is exactly what I expected. The diff however:
The CREATE TABLE statement has the backtick quoting (that the full schema doesn't have) and uses MySQL 3-style boolean emulation with enums. From all the way over here it looks like it's been generated by a different producer with different options, so it might be a DBIC issue instead?
The text was updated successfully, but these errors were encountered: