Commit 78362d58 authored by Karamel's avatar Karamel
Browse files

Update database creation script.

parent cb382351
......@@ -24,6 +24,7 @@ CREATE TABLE tickettaxes (ticket_id INT NOT NULL, tax_id INT NOT NULL, taxRate D
CREATE TABLE discounts (id INT AUTO_INCREMENT NOT NULL, startDate DATETIME DEFAULT NULL, endDate DATETIME DEFAULT NULL, rate DOUBLE PRECISION NOT NULL, barcode VARCHAR(255) DEFAULT NULL, barcodeType INT NOT NULL, disp_order INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE tariffareas (id INT AUTO_INCREMENT NOT NULL, reference VARCHAR(255) NOT NULL, `label` VARCHAR(255) NOT NULL, disp_order INT NOT NULL, UNIQUE INDEX UNIQ_A2F17FC9AEA34913 (reference), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE currencies (id INT AUTO_INCREMENT NOT NULL, reference VARCHAR(255) NOT NULL, `label` VARCHAR(255) NOT NULL, symbol VARCHAR(255) NOT NULL, decimalSeparator VARCHAR(255) NOT NULL, thousandsSeparator VARCHAR(255) NOT NULL, format VARCHAR(255) NOT NULL, rate DOUBLE PRECISION NOT NULL, main TINYINT(1) NOT NULL, visible TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_37C44693AEA34913 (reference), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE sessioncattaxes (cashsession_id INT NOT NULL, reference VARCHAR(255) NOT NULL, tax_id INT NOT NULL, `label` VARCHAR(255) NOT NULL, base DOUBLE PRECISION NOT NULL, amount DOUBLE PRECISION NOT NULL, INDEX IDX_E4084375C914703E (cashsession_id), INDEX IDX_E4084375B2A824D8 (tax_id), PRIMARY KEY(cashsession_id, reference, tax_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE paymentmodevalues (paymentmode_id INT NOT NULL, value DOUBLE PRECISION NOT NULL, hasImage TINYINT(1) NOT NULL, INDEX IDX_4CB607B0ABEEF95F (paymentmode_id), PRIMARY KEY(paymentmode_id, value)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE fiscaltickets (type VARCHAR(255) NOT NULL, sequence VARCHAR(255) NOT NULL, number INT NOT NULL, date DATETIME NOT NULL, content LONGTEXT NOT NULL, signature VARCHAR(255) NOT NULL, PRIMARY KEY(type, sequence, number)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE discountprofiles (id INT AUTO_INCREMENT NOT NULL, `label` VARCHAR(255) NOT NULL, rate DOUBLE PRECISION NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
......@@ -66,5 +67,7 @@ ALTER TABLE ticketpayments ADD CONSTRAINT FK_1D56231D38248176 FOREIGN KEY (curre
ALTER TABLE categories ADD CONSTRAINT FK_3AF34668727ACA70 FOREIGN KEY (parent_id) REFERENCES categories (id);
ALTER TABLE tickettaxes ADD CONSTRAINT FK_AD70C2DB700047D2 FOREIGN KEY (ticket_id) REFERENCES tickets (id);
ALTER TABLE tickettaxes ADD CONSTRAINT FK_AD70C2DBB2A824D8 FOREIGN KEY (tax_id) REFERENCES taxes (id);
ALTER TABLE sessioncattaxes ADD CONSTRAINT FK_E4084375C914703E FOREIGN KEY (cashsession_id) REFERENCES sessions (id);
ALTER TABLE sessioncattaxes ADD CONSTRAINT FK_E4084375B2A824D8 FOREIGN KEY (tax_id) REFERENCES taxes (id);
ALTER TABLE paymentmodevalues ADD CONSTRAINT FK_4CB607B0ABEEF95F FOREIGN KEY (paymentmode_id) REFERENCES paymentmodes (id);
ALTER TABLE users ADD CONSTRAINT FK_1483A5E9D60322AC FOREIGN KEY (role_id) REFERENCES roles (id);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment