15 lines
475 B
MySQL
15 lines
475 B
MySQL
|
CREATE TABLE userProfile
|
||
|
(
|
||
|
id UUID UNIQUE PRIMARY KEY REFERENCES users (id) ON DELETE CASCADE,
|
||
|
createdAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
||
|
updatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
||
|
heroImageUrl TEXT DEFAULT '',
|
||
|
thumbnailImageUrl TEXT DEFAULT ''
|
||
|
);
|
||
|
|
||
|
CREATE TRIGGER userProfile_updated_at
|
||
|
BEFORE UPDATE
|
||
|
ON userProfile
|
||
|
FOR EACH ROW
|
||
|
EXECUTE PROCEDURE updated_at_timestamp();
|