Inventur/inventur_db/migrations/2024-08-21-185127_create_jrcell/up.sql
2024-08-28 23:29:32 +02:00

32 lines
1.2 KiB
SQL

/* This file is part of inventur.
* inventur is a simple web app using rocket to help maintain inventory data.
* Copyright (C) 2024 Johannes Randerath
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
CREATE TABLE jrcells (
id INTEGER AUTO_INCREMENT NOT NULL,
PRIMARY KEY(id),
cell_value VARCHAR(2048) NOT NULL,
jrentry_id INTEGER NOT NULL,
FOREIGN KEY (jrentry_id) REFERENCES jrentries(id)
ON DELETE CASCADE
ON UPDATE CASCADE,
jrcolumn_id INTEGER NOT NULL,
FOREIGN KEY (jrcolumn_id) REFERENCES jrcolumns(id)
ON DELETE CASCADE
ON UPDATE CASCADE
);