Commit abd8c7dd authored by Karamel's avatar Karamel
Browse files

Remove pre-v8 sql scripts and locales.

parent 91d9eb11
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
-- POS-tech is a point of sales software
-- Copyright (C) 2012 SARL SCOP Scil
-- http://trac.scil.coop/pos-tech
--
-- This file is part of Pastèque
--
-- POS-tech is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- POS-tech 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 General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with POS-tech. If not, see <http://www.gnu.org/licenses/>.
-- Database upgrade script for MYSQL
-- db v1 - v2
-- final script
ALTER TABLE PRODUCTS DROP INDEX PRODUCTS_INX_1;
ALTER TABLE PRODUCTS MODIFY PRICEBUY double;
ALTER TABLE CLOSEDCASH MODIFY DATESTART datetime;
UPDATE APPLICATIONS SET VERSION = 2 WHERE ID = "postech";
-- POS-tech is a point of sales software
-- Copyright (C) 2012 SARL SCOP Scil
-- http://trac.scil.coop/pos-tech
--
-- This file is part of Pastèque
--
-- POS-tech is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- POS-tech 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 General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with POS-tech. If not, see <http://www.gnu.org/licenses/>.
-- Database upgrade script for MYSQL
-- db v2 - v3
-- final script
ALTER TABLE PRODUCTS ADD COLUMN DISCOUNTENABLED BIT DEFAULT b'0' NOT NULL;
ALTER TABLE PRODUCTS ADD COLUMN DISCOUNTRATE DOUBLE DEFAULT 0.0 NOT NULL;
ALTER TABLE TICKETS ADD COLUMN CUSTCOUNT INTEGER DEFAULT NULL NULL;
UPDATE APPLICATIONS SET VERSION = 3 WHERE ID = "postech";
-- POS-tech is a point of sales software
-- Copyright (C) 2012 SARL SCOP Scil
-- http://trac.scil.coop/pos-tech
--
-- This file is part of Pastèque
--
-- POS-tech is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- POS-tech 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 General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with POS-tech. If not, see <http://www.gnu.org/licenses/>.
-- Database upgrade script for MYSQL
-- db v3 - v4
-- final script
CREATE TABLE SUBGROUPS (
ID INTEGER NOT NULL AUTO_INCREMENT,
COMPOSITION VARCHAR(255) NOT NULL,
NAME VARCHAR(255) NOT NULL,
REQUIRED BIT DEFAULT b'1' NOT NULL,
IMAGE MEDIUMBLOB,
DISPORDER INTEGER DEFAULT NULL,
PRIMARY KEY(ID),
CONSTRAINT SUBGROUPS_FK_1 FOREIGN KEY (COMPOSITION) REFERENCES PRODUCTS(ID) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE SUBGROUPS_PROD (
SUBGROUP INTEGER NOT NULL AUTO_INCREMENT,
PRODUCT VARCHAR(255) NOT NULL,
DISPORDER INTEGER DEFAULT NULL,
PRIMARY KEY (SUBGROUP, PRODUCT),
CONSTRAINT SUBGROUPS_PROD_FK_1 FOREIGN KEY (SUBGROUP) REFERENCES SUBGROUPS(ID) ON DELETE CASCADE,
CONSTRAINT SUBGROUPS_PROD_FK_2 FOREIGN KEY (PRODUCT) REFERENCES PRODUCTS(ID) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO CATEGORIES(ID, NAME) VALUES ('0', 'Formules');
INSERT INTO CATEGORIES(ID, NAME) VALUES ('-1', 'Pré-paiement');
CREATE TABLE TARIFFAREAS (
ID INTEGER NOT NULL AUTO_INCREMENT,
NAME VARCHAR(255) NOT NULL,
TARIFFORDER INTEGER DEFAULT 0,
PRIMARY KEY(ID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE UNIQUE INDEX TARIFFAREAS_NAME_INX ON TARIFFAREAS(NAME);
CREATE TABLE TARIFFAREAS_PROD (
TARIFFID INTEGER NOT NULL AUTO_INCREMENT,
PRODUCTID VARCHAR(255) NOT NULL,
PRICESELL DOUBLE NOT NULL,
PRIMARY KEY (TARIFFID, PRODUCTID),
CONSTRAINT TARIFFAREAS_PROD_FK_1 FOREIGN KEY (TARIFFID) REFERENCES TARIFFAREAS(ID) ON DELETE CASCADE,
CONSTRAINT TARIFFAREAS_PROD_FK_2 FOREIGN KEY (PRODUCTID) REFERENCES PRODUCTS(ID) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE CATEGORIES ADD COLUMN DISPORDER INTEGER DEFAULT NULL;
ALTER TABLE PRODUCTS ADD COLUMN DELETED BIT DEFAULT b'0' NOT NULL;
ALTER TABLE PRODUCTS DROP INDEX PRODUCTS_NAME_INX;
CREATE INDEX PRODUCTS_NAME_INX ON PRODUCTS(NAME);
ALTER TABLE TICKETS ADD COLUMN TARIFFAREA INTEGER DEFAULT NULL;
ALTER TABLE TICKETS ADD CONSTRAINT TICKETS_TARIFFAREA_FK FOREIGN KEY (TARIFFAREA) REFERENCES TARIFFAREAS(ID);
CREATE TABLE CURRENCIES (
ID INTEGER NOT NULL AUTO_INCREMENT,
NAME VARCHAR(255) NOT NULL,
SYMBOL VARCHAR(10) DEFAULT NULL,
DECIMALSEP VARCHAR(1) DEFAULT NULL,
THOUSANDSSEP VARCHAR(1) DEFAULT NULL,
RATE DOUBLE DEFAULT 1.0 NOT NULL,
FORMAT VARCHAR(20) DEFAULT '#0.00 $' NOT NULL,
MAIN BIT NOT NULL,
ACTIVE BIT DEFAULT b'1' NOT NULL,
PRIMARY KEY (ID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO CURRENCIES(ID, NAME, SYMBOL, DECIMALSEP, THOUSANDSSEP, RATE, FORMAT, MAIN) VALUES (0, 'Euro', '€', ',', ' ', 1.0, '#0.00 $', 1);
ALTER TABLE PAYMENTS ADD COLUMN CURRENCY INTEGER NOT NULL AFTER TOTAL;
ALTER TABLE PAYMENTS ADD COLUMN TOTALCURRENCY DOUBLE NOT NULL AFTER CURRENCY;
UPDATE PAYMENTS SET CURRENCY = 1, TOTALCURRENCY = TOTAL;
ALTER TABLE PAYMENTS ADD CONSTRAINT PAYMENTS_FK_CURRENCY FOREIGN KEY (CURRENCY) REFERENCES CURRENCIES(ID);
ALTER TABLE CUSTOMERS ADD COLUMN PREPAID DOUBLE DEFAULT 0 NOT NULL;
UPDATE APPLICATIONS SET VERSION = 4 WHERE ID = "postech";
-- POS-tech is a point of sales software
-- Copyright (C) 2012 SARL SCOP Scil
-- http://trac.scil.coop/pos-tech
--
-- This file is part of Pastèque
--
-- POS-tech is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- POS-tech 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 General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with POS-tech. If not, see <http://www.gnu.org/licenses/>.
-- Database upgrade script for MYSQL
-- db v3 - v4
-- final script
UPDATE CATEGORIES SET NAME = 'Compositions' WHERE ID = '0';
UPDATE CATEGORIES SET NAME = 'Pre-payment' WHERE ID = '-1';
UPDATE CURRENCIES SET NAME = 'Pound', SYMBOL = '£', DECIMALSEP = '.', THOUSANDSSEP = NULL, FORMAT = '$#0.00' WHERE ID = '1';
-- POS-tech is a point of sales software
-- Copyright (C) 2012 SARL SCOP Scil
-- http://trac.scil.coop/pos-tech
--
-- This file is part of Pastèque
--
-- POS-tech is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- POS-tech 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 General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with POS-tech. If not, see <http://www.gnu.org/licenses/>.
-- Database upgrade script for MYSQL
-- db v4 - v5
-- final script
CREATE TABLE DISCOUNTPROFILES (
ID INTEGER NOT NULL AUTO_INCREMENT,
NAME VARCHAR(255) NOT NULL,
RATE DOUBLE NOT NULL,
DISPORDER INTEGER,
PRIMARY KEY (ID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE CUSTOMERS ADD COLUMN DISCOUNTPROFILE_ID INTEGER;
ALTER TABLE CUSTOMERS ADD CONSTRAINT CUSTOMERS_DISCOUNTPROFILE FOREIGN KEY (DISCOUNTPROFILE_ID) REFERENCES DISCOUNTPROFILES(ID);
CREATE TABLE CASHREGISTERS (
ID INT(11) NOT NULL AUTO_INCREMENT,
NAME VARCHAR(255) NOT NULL,
LOCATION_ID VARCHAR(255) NOT NULL,
NEXTTICKETID INTEGER NOT NULL DEFAULT 1,
PRIMARY KEY (ID),
CONSTRAINT CASHREGISTER_FK_LOCATION FOREIGN KEY (LOCATION_ID) REFERENCES LOCATIONS(ID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Étape manuelle : vérifier combien de caisse il y a et en créer autant qu'il faut
INSERT INTO CASHREGISTERS (NAME, LOCATION_ID) (SELECT distinct(HOST), "0" FROM CLOSEDCASH);
ALTER TABLE CLOSEDCASH ADD COLUMN OPENCASH DOUBLE;
ALTER TABLE CLOSEDCASH ADD COLUMN CLOSECASH DOUBLE;
ALTER TABLE TICKETS ADD COLUMN DISCOUNTRATE DOUBLE NOT NULL DEFAULT 0.0;
ALTER TABLE TICKETS ADD COLUMN DISCOUNTPROFILE_ID INTEGER;
ALTER TABLE TICKETS ADD CONSTRAINT TICKETS_DISCOUNTPROFILE FOREIGN KEY (DISCOUNTPROFILE_ID) REFERENCES DISCOUNTPROFILES(ID);
ALTER TABLE TICKETLINES ADD COLUMN DISCOUNTRATE DOUBLE NOT NULL DEFAULT 0.0;
ALTER TABLE PAYMENTS ADD COLUMN NOTE TEXT;
DELETE FROM SHAREDTICKETS;
UPDATE CASHREGISTERS SET NEXTTICKETID = (SELECT max(ID) FROM TICKETSNUM) + 1;
ALTER TABLE CLOSEDCASH ADD COLUMN CASHREGISTER_ID INT(11) NOT NULL;
UPDATE CLOSEDCASH, CASHREGISTERS SET CASHREGISTER_ID = CASHREGISTERS.ID WHERE CLOSEDCASH.HOST = CASHREGISTERS.NAME;
ALTER TABLE CLOSEDCASH DROP INDEX CLOSEDCASH_INX_SEQ;
ALTER TABLE CLOSEDCASH ADD UNIQUE INDEX CLOSEDCASH_INX_SEQ (CASHREGISTER_ID, HOSTSEQUENCE);
ALTER TABLE CLOSEDCASH ADD CONSTRAINT CLOSEDCASH_FK_CASHREGISTER FOREIGN KEY (CASHREGISTER_ID) REFERENCES CASHREGISTERS(ID);
ALTER TABLE CLOSEDCASH DROP COLUMN HOST;
DROP TABLE TICKETSNUM;
DROP TABLE TICKETSNUM_REFUND;
DROP TABLE TICKETSNUM_PAYMENT;
ALTER TABLE CLOSEDCASH ADD COLUMN EXPECTEDCASH DOUBLE;
ALTER TABLE `SUBGROUPS_PROD` CHANGE `DISPORDER` `DISPORDER` INT( 11 ) NULL;
UPDATE APPLICATIONS SET ID = "pasteque", VERSION = 5 WHERE ID = "postech";
This diff is collapsed.
-- Pasteque is a point of sales software
-- Copyright (C) 2016 SARL SCOP Scil
-- http://github.com/ScilCoop
--
-- This file is part of Pasteque
--
-- POS-tech is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- POS-tech 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 General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with POS-tech. If not, see <http://www.gnu.org/licenses/>.
-- Database upgrade script for MYSQL
-- db v6 - v7
-- final script
-- Modules
ALTER TABLE `APPLICATIONS` ADD COLUMN MODULES TEXT;
UPDATE `APPLICATIONS` SET MODULES = "all";
ALTER TABLE `APPLICATIONS` MODIFY MODULES TEXT NOT NULL;
-- Product label in ticket lines
ALTER TABLE `TICKETLINES` ADD COLUMN PRODUCTLABEL VARCHAR(255) DEFAULT NULL;
-- Compositions and prepayment
ALTER TABLE `PRODUCTS` ADD COLUMN ISCOMPOSITION BIT DEFAULT b'0' NOT NULL;
UPDATE `PRODUCTS` SET ISCOMPOSITION = b'1' WHERE CATEGORY = '0';
ALTER TABLE `PRODUCTS` ADD COLUMN ISPREPAY BIT DEFAULT b'0' NOT NULL;
UPDATE `PRODUCTS` SET ISPREPAY = b'1' WHERE CATEGORY = '-1';
-- Orders
ALTER TABLE `ORDERLINES` CHANGE `ORDER` `ORDER_ID` VARCHAR(255);
ALTER TABLE `ORDERLINES` ADD CONSTRAINT ORDER_LINES_FK_1 FOREIGN KEY (ORDER_ID) REFERENCES ORDERS(ID);
-- Users
ALTER TABLE PEOPLE ALTER COLUMN VISIBLE SET DEFAULT b'1';
-- App version
UPDATE APPLICATIONS SET ID = "pasteque", NAME = "Pasteque", VERSION = 7 WHERE ID = "postech" OR ID = "pasteque";
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
-- POS-tech is a point of sales software
-- Copyright (C) 2012 SARL SCOP Scil
-- http://trac.scil.coop/pos-tech
--
-- This file is part of Pastèque
--
-- POS-tech is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- POS-tech 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 General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with POS-tech. If not, see <http://www.gnu.org/licenses/>.
-- Database upgrade script for POSTGRESQL
-- db v1 - v2
-- final script
ALTER TABLE PRODUCTS DROP INDEX PRODUCTS_INX_1;
ALTER TABLE PRODUCTS ALTER COLUMN PRICE_BUY DROP NOT NULL;
ALTER TABLE CLOSEDCASH ALTER COLUMN DATESTART DROP NOT NULL;
UPDATE APPLICATIONS SET VERSION = 2 WHERE ID = 'postech';
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