feat: reports
This commit is contained in:
@@ -28,6 +28,14 @@ CREATE TABLE study_space_images (
|
||||
PRIMARY KEY (study_space_id, image_path)
|
||||
);
|
||||
|
||||
CREATE TABLE reports (
|
||||
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
study_space_id uuid REFERENCES study_spaces(id) ON DELETE CASCADE,
|
||||
created_at timestamp with time zone DEFAULT now(),
|
||||
updated_at timestamp with time zone DEFAULT now(),
|
||||
type text NOT NULL,
|
||||
content text
|
||||
);
|
||||
|
||||
-- Triggers
|
||||
CREATE TRIGGER study_spaces_updated_at
|
||||
@@ -37,3 +45,7 @@ FOR EACH ROW EXECUTE FUNCTION handle_updated_at();
|
||||
CREATE TRIGGER study_space_images_updated_at
|
||||
AFTER UPDATE ON study_space_images
|
||||
FOR EACH ROW EXECUTE FUNCTION handle_updated_at();
|
||||
|
||||
CREATE TRIGGER reports_updated_at
|
||||
AFTER UPDATE ON reports
|
||||
FOR EACH ROW EXECUTE FUNCTION handle_updated_at();
|
||||
|
||||
Reference in New Issue
Block a user