how do I... NOT NULL attribute for TIMESTAMP
Posted: Wed 14 Jan 2015 22:13
I define a table...
But when I EXPORT or GENERATE SCHEMA SCRIPT I don't get the NOT NULL on the TIMESTAMP...
I really need this attribute definition on my EXPORT, GENERATE and SYNC operations. I'm managing DBs in a DEV, QA and PROD environments, I have corporate policies (NOT NULL on TIMESTAMP) to follow, and it's getting tedious to hand fix this each time.
I forget to fix it, I get kicked by corporate.
Any ideas?
Thx
Walter
Code: Select all
CREATE TABLE user_segment_score_batch (
user_id INT(10) UNSIGNED NOT NULL,
segment_id INT(6) UNSIGNED NOT NULL,
segment_score INT(10) UNSIGNED NOT NULL DEFAULT 0,
created_by INT(10) UNSIGNED NOT NULL DEFAULT 10 COMMENT 'BATCH process ID',
created_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (user_id, segment_id)
)
ENGINE = MEMORY
CHARACTER SET utf8
COLLATE utf8_general_ci;
Code: Select all
CREATE TABLE user_segment_score_batch (
user_id INT(10) UNSIGNED NOT NULL,
segment_id INT(6) UNSIGNED NOT NULL,
segment_score INT(10) UNSIGNED NOT NULL DEFAULT 0,
created_by INT(10) UNSIGNED NOT NULL DEFAULT 10 COMMENT 'BATCH process ID',
created_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (user_id, segment_id)
)
ENGINE = MEMORY
CHARACTER SET utf8
COLLATE utf8_general_ci;
I forget to fix it, I get kicked by corporate.
Any ideas?
Thx
Walter