remove old stacks

This commit is contained in:
2023-09-11 20:12:49 +02:00
parent 205eae2264
commit 4c850f6c0b
174 changed files with 30 additions and 13842 deletions

View File

@@ -0,0 +1,27 @@
CREATE TABLE "inventory_products" (
id VARCHAR(36) NOT NULL,
name TEXT NOT NULL,
description TEXT,
comment TEXT,
PRIMARY KEY (id),
UNIQUE (name)
);
CREATE TABLE "inventory_items_tmp" (
id VARCHAR(36) NOT NULL,
name TEXT NOT NULL,
description TEXT,
weight INTEGER NOT NULL,
category_id VARCHAR(36) NOT NULL,
product_id VARCHAR(36),
PRIMARY KEY (id),
FOREIGN KEY (category_id) REFERENCES inventory_items_categories(id)
FOREIGN KEY (product_id) REFERENCES inventory_products(id)
);
INSERT INTO inventory_items_tmp SELECT *, NULL as product_id FROM inventory_items;
/* DROP TABLE inventory_items; */
/* ALTER TABLE "inventory_items_tmp" RENAME TO inventory_items; */