question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DEFAULT values are not migrated.

See original GitHub issue

Hi, once more issue. MySQL table:

| CREATE TABLE `rates_v2` (
  `host` varchar(20) NOT NULL,
  `rate` varchar(20) NOT NULL DEFAULT '',
  `added` datetime DEFAULT NULL,
  `new` set('N','Y') DEFAULT 'Y',
  `longweek` datetime DEFAULT NULL,
  `longmonth` datetime DEFAULT NULL,
  `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `hostId` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `foreign_key` set('N','Y') DEFAULT 'Y',
  PRIMARY KEY (`host`,`hostId`,`rate`),
  KEY `Host` (`hostId`),
  KEY `rateTableNameIndex` (`new`,`rate`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
r=> \d+ rates_v2;
                                             Table "rates_v2"
   Column    |            Type             | Collation | Nullable | Default | Storage  | Stats target | Description
-------------+-----------------------------+-----------+----------+---------+----------+--------------+-------------
 host        | character varying(20)       |           | not null |         | extended |              |
 rate        | character varying(20)       |           | not null |         | extended |              |
 added       | timestamp without time zone |           |          |         | plain    |              |
 new         | text                        |           |          |         | extended |              |
 longweek    | timestamp without time zone |           |          |         | plain    |              |
 longmonth   | timestamp without time zone |           |          |         | plain    |              |
 updated     | timestamp without time zone |           | not null |         | plain    |              |
 hostId      | integer                     |           | not null |         | plain    |              |
 foreign_key | text                        |           |          |         | extended |              |

As you can see, for the row updated, DEFAULT value CURRENT_TIMESTAMP from MySQL did not migrated into PostgreSQL.

If chameleon is able to resolve this issue right now, or I have to wait for new release? Thanks for answer.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
timkrinscommented, Jul 18, 2022

I also came across this today while using a replicated database after running chameleon detach_replica. It seems everything comes across absolutely fine - all except the default values.

0reactions
bomuvacommented, Oct 27, 2022

Definition of default value for table column still not replicated

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Default value does not work in entity framework code first ...
1 Answer 1 ... The default values aren't retrospectively added for existing records when adding new column to an existing table. You can...
Read more >
constraint is not migrated from SQL server to Snowflake by ...
Table in SQL server source has a Default constraint but when DBMI task is run, default values from source are migrated to Snowflake...
Read more >
Default value for WebformLikert webform element is not ...
Default value for WebformLikert webform element is not migrated properly ; Needs review ; Project: Webform: Migrate ; Version: 8.x-1.x-dev.
Read more >
Attribute default values: Migrating from SDKv2 to the Framework
Specify a default when the Terraform configuration does not supply a value for attributes. Migrate attribute defaults in SDKv2 to AttributePlanModifier in ...
Read more >
Troubleshooting migration tasks in AWS Database Migration ...
For example, it doesn't create secondary indexes, non-primary key constraints, or data defaults. To migrate secondary objects from your database, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found