Skip to content

Commit

Permalink
Use safer default TIMESTAMP.
Browse files Browse the repository at this point in the history
This avoids compatibility issues with differing versions of MySQL.

Using 24 hours after the minimum timestamp value allows for any timezone adjustment that MySQL would do to get a UTC value before storing. The timezone suffix is not supported by all current MySQL versions/derivatives.

Fixes #119
  • Loading branch information
robholland authored Sep 23, 2022
1 parent ff40b89 commit 0591a39
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions schema/mysql/v57/temporal/versioned/v1.0/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -248,13 +248,13 @@ CREATE TABLE cluster_membership
rpc_address VARCHAR(15) NOT NULL,
rpc_port SMALLINT NOT NULL,
role TINYINT NOT NULL,
session_start TIMESTAMP DEFAULT '1970-01-01 00:00:01+00:00',
last_heartbeat TIMESTAMP DEFAULT '1970-01-01 00:00:01+00:00',
record_expiry TIMESTAMP DEFAULT '1970-01-01 00:00:01+00:00',
session_start TIMESTAMP DEFAULT '1970-01-02 00:00:01',
last_heartbeat TIMESTAMP DEFAULT '1970-01-02 00:00:01',
record_expiry TIMESTAMP DEFAULT '1970-01-02 00:00:01',
INDEX (role, host_id),
INDEX (role, last_heartbeat),
INDEX (rpc_address, role),
INDEX (last_heartbeat),
INDEX (record_expiry),
PRIMARY KEY (membership_partition, host_id)
);
);

0 comments on commit 0591a39

Please # to comment.