Skip to content

datetime types are not quoted #105

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

Open
KES777 opened this issue Jul 10, 2018 · 0 comments · May be fixed by #106
Open

datetime types are not quoted #105

KES777 opened this issue Jul 10, 2018 · 0 comments · May be fixed by #106

Comments

@KES777
Copy link
Contributor

KES777 commented Jul 10, 2018

DBG>$from_field
SQL::Translator::Schema::Field {
  _ERROR => ,
  comments => [],
  data_type => timestamp with time zone,
  default_value => \'9999-12-31 23:59:59'::timestamp with time zone,
  extra => {},
  is_auto_increment => 0,
  is_nullable => 0,
  is_primary_key => 0,
  name => known_till,
  order => 4,
  size => [
    0,
  ],
  table => SQL::Translator::Schema::Table person,
}

DBG>$to_field
SQL::Translator::Schema::Field {
  _ERROR => ,
  comments => [],
  data_type => timestamp with time zone,
  default_value => 9999-12-31 23:59:59,
  extra => {},
  is_auto_increment => 0,
  is_nullable => 0,
  is_primary_key => 0,
  name => known_till,
  order => 4,
  size => [
    0,
  ],
  sql_data_type => 0,
  table => SQL::Translator::Schema::Table person,
}

generates correct upgrade sql:

ALTER TABLE person ALTER COLUMN known_till SET DEFAULT '9999-12-31 23:59:59'::timestamp with time zone;

and wrong downgrade:

ALTER TABLE person ALTER COLUMN known_till SET DEFAULT 9999-12-31 23:59:59;
@KES777 KES777 linked a pull request Jul 10, 2018 that will close this issue
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