astral-api/Astral.DAL/Migrations/2024-12-10.05-userProfile.sql

15 lines
475 B
MySQL
Raw Normal View History

2024-12-11 21:36:30 +01:00
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();