We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
CREATE TABLE `onupdate` ( `id` int(11) NOT NULL AUTO_INCREMENT, `patient_id` varchar(50) NOT NULL, `update_date1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `update_date2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE current_timestamp(), `update_date3` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp(), `update_date4` timestamp NULL ON UPDATE current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `patient_id` (`patient_id`) );
then show COLUMNS
SHOW COLUMNS FROM onupdate;
+--------------+-------------+------+-----+-------------------+-----------------------------------------------+ | Field | Type | Null | Key | Default | Extra | +--------------+-------------+------+-----+-------------------+-----------------------------------------------+ | id | int | NO | PRI | NULL | auto_increment | | patient_id | varchar(50) | NO | UNI | NULL | | | update_date1 | timestamp | NO | | CURRENT_TIMESTAMP | DEFAULT_GENERATED on update CURRENT_TIMESTAMP | | update_date2 | timestamp | NO | | CURRENT_TIMESTAMP | DEFAULT_GENERATED on update CURRENT_TIMESTAMP | | update_date3 | timestamp | YES | | NULL | on update CURRENT_TIMESTAMP | | update_date4 | timestamp | YES | | NULL | on update CURRENT_TIMESTAMP | +--------------+-------------+------+-----+-------------------+-----------------------------------------------+
loader@/tmp:loader> \df +--------+--------------------------------------+------------------+---------------------+---------+ | Schema | Name | Result data type | Argument data types | Type | |--------+--------------------------------------+------------------+---------------------+---------| | loader | on_update_current_timestamp_onupdate | trigger | | trigger | +--------+--------------------------------------+------------------+---------------------+---------+ SELECT 1 Time: 0.092s
Any additional information that is available about a given column. The value is nonempty in these cases:
auto_increment for columns that have the AUTO_INCREMENT attribute.
on update CURRENT_TIMESTAMP for TIMESTAMP or DATETIME columns that have the ON UPDATE CURRENT_TIMESTAMP attribute.
VIRTUAL GENERATED or STORED GENERATED for generated columns.
DEFAULT_GENERATED for columns that have an expression default value.
I add a judgmental condition as a temporary solution
;;; src/sources/mysql/mysql-cast-rules.lisp (defun normalize-extra (extra) "Normalize MySQL strings into pgloader CL keywords for internal processing." (cond ((string= "auto_increment" extra) :auto-increment) ((or (string= extra "on update CURRENT_TIMESTAMP") (string= extra "on update current_timestamp()") (string= extra "DEFAULT_GENERATED on update CURRENT_TIMESTAMP")) :on-update-current-timestamp)))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
mysql
then show COLUMNS
pg
Extra
Any additional information that is available about a given column. The value is nonempty in these cases:
auto_increment for columns that have the AUTO_INCREMENT attribute.
on update CURRENT_TIMESTAMP for TIMESTAMP or DATETIME columns that have the ON UPDATE CURRENT_TIMESTAMP attribute.
VIRTUAL GENERATED or STORED GENERATED for generated columns.
DEFAULT_GENERATED for columns that have an expression default value.
fix
I add a judgmental condition as a temporary solution
The text was updated successfully, but these errors were encountered: