astral-api/Astral.DAL/Migrations/2024-12-10.05-userProfile.sql
2024-12-11 20:36:30 +00:00

14 lines
475 B
SQL

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();