- Update
tags_assigned table to have resource in the assigned_to enum via knex migration
- Add
resources table with relevant relations via knex migration
- Add constraint to ensure that Every resource should have either a Description or an Attachment (link, filename)
- Check if it’s possible (and if it makes sense) to add a db constraint to ensure:
For type = 'post' → description required
For type = 'video' → link required
- Update db diagram in the repo
Table resources:
id: int (primary key)
title: VARCHAR(255) NOT NULL
type: ENUM('post', 'video', ‘picture’, ‘link’, ‘file’) NOT NULL
audience: ENUM('public', 'member', 'mentor') NOT NULL
tags: relation to (‘tags_assigned’) table
description: TEXT
attachment_filename: VARCHAR(255)
link: VARCHAR(500)
created_by: UUID (foreign key to users.id)
created_at: TIMESTAMP
updated_at: TIMESTAMP
tags_assignedtable to haveresourcein theassigned_toenum via knex migrationresourcestable with relevant relations via knex migrationFor type = 'post' → description required
For type = 'video' → link required
Table resources:
id: int (primary key)
title: VARCHAR(255) NOT NULL
type: ENUM('post', 'video', ‘picture’, ‘link’, ‘file’) NOT NULL
audience: ENUM('public', 'member', 'mentor') NOT NULL
tags: relation to (‘tags_assigned’) table
description: TEXT
attachment_filename: VARCHAR(255)
link: VARCHAR(500)
created_by: UUID (foreign key to users.id)
created_at: TIMESTAMP
updated_at: TIMESTAMP