Inventur/inventur_db/migrations/2024-08-31-094645_create_shares/up.sql
Johannes Randerath 61708e5199 Sharing tables readonly with other users
- Added sharing feature for table owners to share their tables with
  other registered users.
- Fixed a bug where the wrong entries would be deleted or modified when
  searching or filtering.
2024-09-01 20:17:14 +02:00

14 lines
416 B
SQL

CREATE TABLE shares (
id INTEGER AUTO_INCREMENT UNIQUE NOT NULL,
PRIMARY KEY(id),
sharee_id INTEGER NOT NULL,
FOREIGN KEY (sharee_id) REFERENCES users(id)
ON DELETE CASCADE
ON UPDATE CASCADE,
tblid INTEGER NOT NULL,
FOREIGN KEY (tblid) REFERENCES jrtables(id)
ON DELETE CASCADE
ON UPDATE CASCADE,
readonly BOOLEAN NOT NULL DEFAULT true
);