Commit 08cc7132 authored by Karamel's avatar Karamel
Browse files

Update database schema script.

parent fc73a2b0
......@@ -5,7 +5,7 @@ CREATE TABLE floors (id INT AUTO_INCREMENT NOT NULL, `label` VARCHAR(255) NOT NU
CREATE TABLE compositiongroups (id INT AUTO_INCREMENT NOT NULL, product_id INT NOT NULL, `label` VARCHAR(255) NOT NULL, disp_order INT NOT NULL, image LONGBLOB DEFAULT NULL, INDEX IDX_C72568934584665A (product_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE sessioncustbalances (cashsession_id INT NOT NULL, customer_id INT NOT NULL, balance DOUBLE PRECISION NOT NULL, INDEX IDX_9D3CBD8BC914703E (cashsession_id), INDEX IDX_9D3CBD8B9395C3F3 (customer_id), PRIMARY KEY(cashsession_id, customer_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE options (name VARCHAR(255) NOT NULL, system TINYINT(1) NOT NULL, content LONGTEXT NOT NULL, PRIMARY KEY(name)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE sessiontaxes (cashsession_id INT NOT NULL, tax_id INT NOT NULL, taxRate DOUBLE PRECISION NOT NULL, base DOUBLE PRECISION NOT NULL, amount DOUBLE PRECISION NOT NULL, INDEX IDX_59DAD7C9C914703E (cashsession_id), INDEX IDX_59DAD7C9B2A824D8 (tax_id), PRIMARY KEY(cashsession_id, tax_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE sessiontaxes (cashsession_id INT NOT NULL, tax_id INT NOT NULL, taxRate DOUBLE PRECISION NOT NULL, base DOUBLE PRECISION NOT NULL, basePeriod DOUBLE PRECISION NOT NULL, baseFYear DOUBLE PRECISION NOT NULL, amount DOUBLE PRECISION NOT NULL, amountPeriod DOUBLE PRECISION NOT NULL, amountFYear DOUBLE PRECISION NOT NULL, INDEX IDX_59DAD7C9C914703E (cashsession_id), INDEX IDX_59DAD7C9B2A824D8 (tax_id), PRIMARY KEY(cashsession_id, tax_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE products (id INT AUTO_INCREMENT NOT NULL, category_id INT NOT NULL, tax_id INT NOT NULL, reference VARCHAR(255) NOT NULL, barcode VARCHAR(255) DEFAULT NULL, `label` VARCHAR(255) NOT NULL, priceBuy DOUBLE PRECISION DEFAULT NULL, priceSell DOUBLE PRECISION NOT NULL, visible TINYINT(1) NOT NULL, scaled TINYINT(1) NOT NULL, scaleType SMALLINT NOT NULL, scaleValue DOUBLE PRECISION NOT NULL, disp_order INT NOT NULL, hasImage TINYINT(1) NOT NULL, discountEnabled TINYINT(1) NOT NULL, discountRate DOUBLE PRECISION NOT NULL, prepay TINYINT(1) NOT NULL, composition TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_B3BA5A5AAEA34913 (reference), INDEX IDX_B3BA5A5A12469DE2 (category_id), INDEX IDX_B3BA5A5AB2A824D8 (tax_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE customers (id INT AUTO_INCREMENT NOT NULL, tax_id INT DEFAULT NULL, discountprofile_id INT DEFAULT NULL, dispName VARCHAR(255) NOT NULL, card VARCHAR(255) NOT NULL, firstName VARCHAR(255) NOT NULL, lastName VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, phone1 VARCHAR(255) NOT NULL, phone2 VARCHAR(255) NOT NULL, fax VARCHAR(255) NOT NULL, addr1 VARCHAR(255) NOT NULL, addr2 VARCHAR(255) NOT NULL, zipCode VARCHAR(255) NOT NULL, city VARCHAR(255) NOT NULL, region VARCHAR(255) NOT NULL, country VARCHAR(255) NOT NULL, balance DOUBLE PRECISION NOT NULL, maxDebt DOUBLE PRECISION NOT NULL, note LONGTEXT NOT NULL, visible TINYINT(1) NOT NULL, expireDate DATETIME DEFAULT NULL, hasImage TINYINT(1) NOT NULL, INDEX IDX_62534E21B2A824D8 (tax_id), INDEX IDX_62534E21E1BC3B58 (discountprofile_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE sessioncats (cashsession_id INT NOT NULL, reference VARCHAR(255) NOT NULL, `label` VARCHAR(255) NOT NULL, amount DOUBLE PRECISION NOT NULL, INDEX IDX_F32F3B52C914703E (cashsession_id), PRIMARY KEY(cashsession_id, reference)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
......@@ -17,7 +17,7 @@ CREATE TABLE compositionproducts (compositiongroup_id INT NOT NULL, product_id I
CREATE TABLE cashregisters (id INT AUTO_INCREMENT NOT NULL, reference VARCHAR(255) NOT NULL, `label` VARCHAR(255) NOT NULL, nextTicketId INT NOT NULL, nextSessionId INT NOT NULL, UNIQUE INDEX UNIQ_4DC8569BAEA34913 (reference), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE sessionpayments (cashsession_id INT NOT NULL, paymentmode_id INT NOT NULL, currency_id INT NOT NULL, amount DOUBLE PRECISION NOT NULL, currencyAmount DOUBLE PRECISION NOT NULL, INDEX IDX_342F815C914703E (cashsession_id), INDEX IDX_342F815ABEEF95F (paymentmode_id), INDEX IDX_342F81538248176 (currency_id), PRIMARY KEY(cashsession_id, paymentmode_id, currency_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE ticketlines (ticket_id INT NOT NULL, product_id INT DEFAULT NULL, tax_id INT NOT NULL, dispOrder INT NOT NULL, productLabel VARCHAR(255) NOT NULL, unitPrice DOUBLE PRECISION NOT NULL, quantity DOUBLE PRECISION NOT NULL, price DOUBLE PRECISION NOT NULL, taxRate DOUBLE PRECISION NOT NULL, taxAmount DOUBLE PRECISION NOT NULL, totalAmount DOUBLE PRECISION NOT NULL, discountRate DOUBLE PRECISION NOT NULL, discountPrice DOUBLE PRECISION NOT NULL, discountTax DOUBLE PRECISION NOT NULL, discountTotal DOUBLE PRECISION NOT NULL, INDEX IDX_20FFE9B5700047D2 (ticket_id), INDEX IDX_20FFE9B54584665A (product_id), INDEX IDX_20FFE9B5B2A824D8 (tax_id), PRIMARY KEY(ticket_id, dispOrder)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE sessions (id INT AUTO_INCREMENT NOT NULL, cashregister_id INT NOT NULL, sequence INT NOT NULL, continuous TINYINT(1) NOT NULL, openDate DATETIME DEFAULT NULL, closeDate DATETIME DEFAULT NULL, openCash DOUBLE PRECISION DEFAULT NULL, closeCash DOUBLE PRECISION DEFAULT NULL, expectedCash DOUBLE PRECISION DEFAULT NULL, ticketCount INT DEFAULT NULL, custCount INT DEFAULT NULL, cs DOUBLE PRECISION DEFAULT NULL, INDEX IDX_9A609D139ED3320C (cashregister_id), UNIQUE INDEX session_index (cashregister_id, sequence), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE sessions (id INT AUTO_INCREMENT NOT NULL, cashregister_id INT NOT NULL, sequence INT NOT NULL, continuous TINYINT(1) NOT NULL, openDate DATETIME DEFAULT NULL, closeDate DATETIME DEFAULT NULL, openCash DOUBLE PRECISION DEFAULT NULL, closeCash DOUBLE PRECISION DEFAULT NULL, expectedCash DOUBLE PRECISION DEFAULT NULL, ticketCount INT DEFAULT NULL, custCount INT DEFAULT NULL, cs DOUBLE PRECISION DEFAULT NULL, csPeriod DOUBLE PRECISION NOT NULL, csFYear DOUBLE PRECISION NOT NULL, INDEX IDX_9A609D139ED3320C (cashregister_id), UNIQUE INDEX session_index (cashregister_id, sequence), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE ticketpayments (ticket_id INT NOT NULL, paymentmode_id INT NOT NULL, currency_id INT NOT NULL, dispOrder INT NOT NULL, amount DOUBLE PRECISION NOT NULL, currencyAmount DOUBLE PRECISION NOT NULL, INDEX IDX_1D56231D700047D2 (ticket_id), INDEX IDX_1D56231DABEEF95F (paymentmode_id), INDEX IDX_1D56231D38248176 (currency_id), PRIMARY KEY(ticket_id, dispOrder)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE categories (id INT AUTO_INCREMENT NOT NULL, parent_id INT DEFAULT NULL, reference VARCHAR(255) NOT NULL, `label` VARCHAR(255) NOT NULL, hasImage TINYINT(1) NOT NULL, disp_order INT NOT NULL, UNIQUE INDEX UNIQ_3AF34668AEA34913 (reference), INDEX IDX_3AF34668727ACA70 (parent_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE tickettaxes (ticket_id INT NOT NULL, tax_id INT NOT NULL, taxRate DOUBLE PRECISION NOT NULL, base DOUBLE PRECISION NOT NULL, amount DOUBLE PRECISION NOT NULL, INDEX IDX_AD70C2DB700047D2 (ticket_id), INDEX IDX_AD70C2DBB2A824D8 (tax_id), PRIMARY KEY(ticket_id, tax_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
......
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