This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
Foodloop-Server/share/ddl/SQLite/upgrade/13-14/001-auto.sql

35 lines
834 B
MySQL
Raw Normal View History

2017-10-26 15:29:56 +00:00
-- Convert schema 'share/ddl/_source/deploy/13/001-auto.yml' to 'share/ddl/_source/deploy/14/001-auto.yml':;
;
BEGIN;
;
CREATE TABLE import_sets (
id INTEGER PRIMARY KEY NOT NULL,
date datetime NOT NULL
);
;
CREATE TABLE import_values (
id INTEGER PRIMARY KEY NOT NULL,
set_id integer NOT NULL,
user_name varchar(255) NOT NULL,
purchase_date datetime NOT NULL,
purchase_value varchar(255) NOT NULL,
org_name varchar(255) NOT NULL,
transaction_id varchar,
FOREIGN KEY (set_id) REFERENCES import_sets(id) ON DELETE NO ACTION ON UPDATE NO ACTION,
FOREIGN KEY (transaction_id) REFERENCES transactions(id) ON DELETE NO ACTION ON UPDATE NO ACTION
);
;
CREATE INDEX import_values_idx_set_id ON import_values (set_id);
;
CREATE INDEX import_values_idx_transaction_id ON import_values (transaction_id);
;
COMMIT;