PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL);
INSERT INTO "schema_migrations" VALUES('20120720220642');
INSERT INTO "schema_migrations" VALUES('20120720221116');
INSERT INTO "schema_migrations" VALUES('20120722001722');
INSERT INTO "schema_migrations" VALUES('20120722003603');
INSERT INTO "schema_migrations" VALUES('20120729163311');
INSERT INTO "schema_migrations" VALUES('20120729164016');
INSERT INTO "schema_migrations" VALUES('20120729174648');
INSERT INTO "schema_migrations" VALUES('20120729182035');
INSERT INTO "schema_migrations" VALUES('20120729185015');
INSERT INTO "schema_migrations" VALUES('20120729190513');
INSERT INTO "schema_migrations" VALUES('20120729231230');
INSERT INTO "schema_migrations" VALUES('20120729231628');
INSERT INTO "schema_migrations" VALUES('20120731165222');
INSERT INTO "schema_migrations" VALUES('20120731192308');
INSERT INTO "schema_migrations" VALUES('20120802153801');
INSERT INTO "schema_migrations" VALUES('20120802203305');
INSERT INTO "schema_migrations" VALUES('20120803040631');
INSERT INTO "schema_migrations" VALUES('20120803041641');
INSERT INTO "schema_migrations" VALUES('20120809004756');
INSERT INTO "schema_migrations" VALUES('20120809141715');
INSERT INTO "schema_migrations" VALUES('20120810000006');
INSERT INTO "schema_migrations" VALUES('20120810001033');
INSERT INTO "schema_migrations" VALUES('20120906231318');
INSERT INTO "schema_migrations" VALUES('20120921220138');
INSERT INTO "schema_migrations" VALUES('20120921220813');
INSERT INTO "schema_migrations" VALUES('20121010204647');
INSERT INTO "schema_migrations" VALUES('20121026205727');
INSERT INTO "schema_migrations" VALUES('20121026213542');
INSERT INTO "schema_migrations" VALUES('20121101190009');
INSERT INTO "schema_migrations" VALUES('20130303193539');
INSERT INTO "schema_migrations" VALUES('20130303193958');
INSERT INTO "schema_migrations" VALUES('20130303194626');
INSERT INTO "schema_migrations" VALUES('20130403142148');
INSERT INTO "schema_migrations" VALUES('20130603210837');
INSERT INTO "schema_migrations" VALUES('20130626202544');
INSERT INTO "schema_migrations" VALUES('20130709201736');
INSERT INTO "schema_migrations" VALUES('20130710203000');
INSERT INTO "schema_migrations" VALUES('20130816202119');
INSERT INTO "schema_migrations" VALUES('20131003191702');
INSERT INTO "schema_migrations" VALUES('20131004204055');
INSERT INTO "schema_migrations" VALUES('20131005214916');
INSERT INTO "schema_migrations" VALUES('20140104184410');
INSERT INTO "schema_migrations" VALUES('20140125205141');
CREATE TABLE "countries" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "latin_name" varchar(255));
CREATE TABLE "rails_admin_histories" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "message" text, "username" varchar(255), "item" integer, "table" varchar(255), "month" integer(2), "year" integer(5), "created_at" datetime, "updated_at" datetime);
CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime, "updated_at" datetime, "login" varchar(255), "last_name" varchar(255), "first_name" varchar(255), "role_id" integer);
CREATE TABLE "roles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT '' NOT NULL, "visible" boolean, "created_at" datetime, "updated_at" datetime);
CREATE TABLE "cities" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "latin_name" varchar(255), "created_at" datetime, "updated_at" datetime, "country_id" integer);
CREATE TABLE "restaurants_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "restaurant_id" integer, "user_id" integer);
CREATE TABLE "sections" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "latin_name" varchar(255), "section_id" integer, "restaurant_id" integer, "sort_by" integer, "image" varchar(255), "division_id" integer);
CREATE TABLE "details" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "dish_id" integer, "count" integer, "price" float DEFAULT 0 NOT NULL);
CREATE TABLE "dishes" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "restaurant_id" integer, "name" varchar(255), "desc" text, "image" varchar(255), "available" boolean, "section_id" integer, "price" float DEFAULT 0 NOT NULL, "sort_by" integer, "picture_file_name" varchar(255), "picture_content_type" varchar(255), "picture_file_size" integer, "picture_updated_at" datetime);
CREATE TABLE "tables" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "restaurant_id" integer, "user_id" integer, "name" varchar(255) DEFAULT '' NOT NULL, "device" varchar(255), "busy" boolean DEFAULT 'f' NOT NULL, "created_at" datetime, "updated_at" datetime, "table_status_id" integer, "server" boolean DEFAULT 'f');
CREATE TABLE "statuses" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "role_id" integer);
CREATE TABLE "main_menu_items" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT '', "route" varchar(255), "seq" integer DEFAULT 0, "created_at" datetime, "updated_at" datetime);
INSERT INTO "main_menu_items" VALUES(1,'menu.about.company','about_company',1,'2015-01-19 02:23:27.811339','2015-01-19 02:23:27.811339');
INSERT INTO "main_menu_items" VALUES(2,'menu.about.product','about_product',2,'2015-01-19 02:23:27.813447','2015-01-19 02:23:27.813447');
INSERT INTO "main_menu_items" VALUES(3,'menu.about.partners','root',3,'2015-01-19 02:23:27.814714','2015-01-19 02:23:27.814714');
INSERT INTO "main_menu_items" VALUES(4,'menu.about.contacts','contacts',4,'2015-01-19 02:23:27.815865','2015-01-19 02:23:27.815865');
INSERT INTO "main_menu_items" VALUES(5,'menu.about.demo','demo',5,'2015-01-19 02:23:27.817021','2015-01-19 02:23:27.817021');
INSERT INTO "main_menu_items" VALUES(6,'menu.registration','new_user_registration',6,'2015-01-19 02:23:27.818114','2015-01-19 02:23:27.818114');
INSERT INTO "main_menu_items" VALUES(7,'menu.login','manage',7,'2015-01-19 02:23:27.819141','2015-01-19 02:23:27.819141');
CREATE TABLE "table_statuses" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "image" varchar(255), "created_at" datetime, "updated_at" datetime);
CREATE TABLE "gritter_notices" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "owner_id" integer NOT NULL, "owner_type" varchar(255) NOT NULL, "text" text NOT NULL, "options" text NOT NULL, "delivered_at" datetime, "created_at" datetime, "updated_at" datetime);
CREATE TABLE "devices" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "restaurant_id" integer, "user_id" integer, "created_at" datetime, "updated_at" datetime);
CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "restaurant_id" integer, "user_id" integer, "sum" float, "created_at" datetime, "updated_at" datetime, "table_id" integer, "status_id" integer, "device_id" integer, "discount_id" integer);
CREATE TABLE "employees" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "status_id" integer, "restaurant_id" integer, "created_at" datetime, "updated_at" datetime);
CREATE TABLE "measures" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime);
CREATE TABLE "ingredients" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "measure_id" integer, "created_at" datetime, "updated_at" datetime);
CREATE TABLE "recipes" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "dish_id" integer, "ingredient_id" integer, "quantity" float, "measure_id" integer, "created_at" datetime, "updated_at" datetime);
CREATE TABLE "discounts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "discount" integer, "restaurant_id" integer, "created_at" datetime, "updated_at" datetime, "every" boolean);
CREATE TABLE "discounts_dishes" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "discount_id" integer, "dish_id" integer);
CREATE TABLE "delayed_jobs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "priority" integer DEFAULT 0 NOT NULL, "attempts" integer DEFAULT 0 NOT NULL, "handler" text NOT NULL, "last_error" text, "run_at" datetime, "locked_at" datetime, "failed_at" datetime, "locked_by" varchar(255), "queue" varchar(255), "created_at" datetime, "updated_at" datetime);
CREATE TABLE "divisions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "latin_name" varchar(255), "restaurant_id" integer, "sort_by" integer, "created_at" datetime, "updated_at" datetime, "image_file_name" varchar(255), "image_content_type" varchar(255), "image_file_size" integer, "image_updated_at" datetime);
CREATE TABLE "restaurants" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "latin_name" varchar(255), "check_header" text, "check_footer" text, "city_id" integer, "created_at" datetime, "updated_at" datetime, "code" integer, "menu_updated_at" datetime, "fallback_table_id" integer, "internet_table_id" integer);
DELETE FROM sqlite_sequence;
INSERT INTO "sqlite_sequence" VALUES('main_menu_items',7);
CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version");
CREATE INDEX "index_rails_admin_histories" ON "rails_admin_histories" ("item", "table", "month", "year");
CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email");
CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token");
CREATE UNIQUE INDEX "index_roles_on_name" ON "roles" ("name");
CREATE UNIQUE INDEX "index_users_on_login" ON "users" ("login");
CREATE UNIQUE INDEX "index_countries_on_latin_name" ON "countries" ("latin_name");
CREATE UNIQUE INDEX "index_cities_on_latin_name" ON "cities" ("latin_name");
CREATE INDEX "index_tables_on_name" ON "tables" ("name");
CREATE INDEX "index_gritter_notices_on_owner_id_and_delivered_at" ON "gritter_notices" ("owner_id", "delivered_at");
CREATE INDEX "index_ingredients_on_measure_id" ON "ingredients" ("measure_id");
CREATE INDEX "index_recipes_on_dish_id" ON "recipes" ("dish_id");
CREATE INDEX "index_recipes_on_ingredient_id" ON "recipes" ("ingredient_id");
CREATE INDEX "index_recipes_on_measure_id" ON "recipes" ("measure_id");
CREATE INDEX "delayed_jobs_priority" ON "delayed_jobs" ("priority", "run_at");
CREATE UNIQUE INDEX "index_restaurants_on_latin_name" ON "restaurants" ("latin_name");
CREATE UNIQUE INDEX "index_restaurants_on_code" ON "restaurants" ("code");
COMMIT;
