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

datetime types are not quoted #105

Open
KES777 opened this issue Jul 10, 2018 · 0 comments
Open

datetime types are not quoted #105

KES777 opened this issue Jul 10, 2018 · 0 comments

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;
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

1 participant