tnc-ba / strongTNC

BYOD TNC Database Management Tool
GNU Affero General Public License v3.0
0 stars 0 forks source link

Modify current models to match sql schema #117

Closed dbrgn closed 10 years ago

dbrgn commented 10 years ago

See #79

dbrgn commented 10 years ago

Oops, I accidentally the internet created this PR against master, not futuremaster. Ignore the first (swid app) commit.

dbrgn commented 10 years ago

Add label to components:

BEGIN TRANSACTION;
DROP TABLE components;
CREATE TABLE "components" (
    "id" integer NOT NULL PRIMARY KEY,
    "vendor_id" integer NOT NULL,
    "name" integer NOT NULL,
    "qualifier" integer NOT NULL,
    "label" varchar(255) NOT NULL
);
COMMIT;

Add trusted flag:

BEGIN TRANSACTION;
CREATE TABLE devices_backup(id, description, value, product, created);
INSERT INTO devices_backup SELECT * FROM devices;
DROP TABLE devices;
CREATE TABLE devices (
    "id" integer NOT NULL PRIMARY KEY,
    "value" varchar(255) NOT NULL,
    "description" text,
    "product" integer NOT NULL REFERENCES "products" ("id"),
    "trusted" integer NOT NULL,
    "created" integer
);
CREATE INDEX "devices_f6915675" ON "devices" ("value");
CREATE INDEX "devices_7f1b40ad" ON "devices" ("product");
INSERT INTO devices SELECT id, value, description, product, 1, created FROM devices_backup;
DROP TABLE devices_backup;
COMMIT;
dbrgn commented 10 years ago

Ready for review, @d22 :)

dbrgn commented 10 years ago

Merged in branch futuremaster.