· 8 years ago · Mar 18, 2018, 02:32 AM
1DROP TABLE IF EXISTS `account_type`;
2
3CREATE TABLE `account_type` (
4 `id` int(11) NOT NULL AUTO_INCREMENT,
5 `name` varchar(255) NOT NULL,
6 `description` varchar(255) DEFAULT NULL,
7 PRIMARY KEY (`id`)
8) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
9
10/*Data for the table `account_type` */
11
12LOCK TABLES `account_type` WRITE;
13
14insert into `account_type`(`id`,`name`,`description`) values (1,'LVL 1','Employee'),(2,'LVL 2','Admin'),(3,'LVL 3','Super Admin');
15
16UNLOCK TABLES;
17
18/*Table structure for table `accounts` */
19
20DROP TABLE IF EXISTS `accounts`;
21
22CREATE TABLE `accounts` (
23 `id` int(11) NOT NULL AUTO_INCREMENT,
24 `first_name` varchar(100) DEFAULT NULL,
25 `last_name` varchar(100) DEFAULT NULL,
26 `username` varchar(30) NOT NULL,
27 `password` varchar(60) DEFAULT NULL,
28 `pincode` varchar(11) DEFAULT NULL,
29 `email` varchar(60) DEFAULT NULL,
30 `phone_no` varchar(30) DEFAULT NULL,
31 `image` varchar(255) DEFAULT NULL,
32 `account_type_id` int(11) NOT NULL DEFAULT '1',
33 `approved_by` int(11) DEFAULT NULL,
34 `date_approved` datetime DEFAULT NULL,
35 `date_created` datetime DEFAULT NULL,
36 `date_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
37 `is_deleted` tinyint(1) DEFAULT '0',
38 PRIMARY KEY (`id`,`username`)
39) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
40
41/*Data for the table `accounts` */
42
43LOCK TABLES `accounts` WRITE;
44
45insert into `accounts`(`id`,`first_name`,`last_name`,`username`,`password`,`pincode`,`email`,`phone_no`,`image`,`account_type_id`,`approved_by`,`date_approved`,`date_created`,`date_modified`,`is_deleted`) values (1,'Eleoqwe','Milag','eleo','81dc9bdb52d04dc20036dbd8313ed055','','eleo@s.com','0945641',NULL,2,2,'2018-02-04 08:15:00','2018-02-04 07:55:39','2018-02-04 08:43:44',0),(2,'Adminww','Adminee','admin','202cb962ac59075b964b07152d234b70','','admin@admin.com','1324',NULL,3,NULL,'2018-02-04 07:55:39','2018-02-04 07:55:39','2018-02-04 08:44:41',0);
46
47UNLOCK TABLES;
48
49DROP TABLE IF EXISTS `report_issues`;
50
51CREATE TABLE `report_issues` (
52 `id` int(11) NOT NULL AUTO_INCREMENT,
53 `account_id` int(11) DEFAULT NULL,
54 `message` varchar(255) DEFAULT NULL,
55 `date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
56 PRIMARY KEY (`id`)
57) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
58
59/*Data for the table `report_issues` */
60
61LOCK TABLES `report_issues` WRITE;
62
63insert into `report_issues`(`id`,`account_id`,`message`,`date_created`) values (1,2,'hahayz','2018-02-04 08:44:52');
64
65UNLOCK TABLES;
66
67ALTER TABLE `ipdb_enter`.`categ_main`
68 ADD COLUMN `date_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP NULL;
69
70ALTER TABLE `ipdb_enter`.`categ_sub`
71 ADD COLUMN `date_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP NULL;
72
73
74DROP TABLE IF EXISTS `global_variable`;
75CREATE TABLE `global_variable` (
76 `id` int(11) NOT NULL AUTO_INCREMENT,
77 `name` varchar(100) DEFAULT NULL,
78 `value` varchar(100) DEFAULT NULL,
79 PRIMARY KEY (`id`)
80) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
81/*Data for the table `global_variable` */
82LOCK TABLES `global_variable` WRITE;
83insert into `global_variable`(`id`,`name`,`value`) values (1,'st_address','sample address here'),(2,'st_phone_number','090909090909'),(3,'st_store_name','Indian Palace');
84UNLOCK TABLES;
85
86DROP TABLE IF EXISTS `order_parent`;
87CREATE TABLE `order_parent`(
88 `id` VARCHAR(100) NOT NULL,
89 `account_id` INT(11),
90 `total_amount` DOUBLE(11,4),
91 `status_id` INT(11),
92 `date_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
93 `date_closed` DATETIME ,
94 PRIMARY KEY (`id`)
95);
96
97ALTER TABLE `product_t`
98ADD COLUMN `quantity_warehouse` INT(11) NULL AFTER `reorder_quantity`,
99ADD COLUMN `quantity_available` INT(11) NULL AFTER `quantity_warehouse`,
100ADD COLUMN `quantity_reserved` INT(11) NULL AFTER `quantity_available`;
101
102CREATE TABLE `product_movement`(
103 `id` INT(11) NOT NULL AUTO_INCREMENT,
104 `meta_data` VARCHAR(100),
105 `meta_data_id` INT(11),
106 `parent_id` INT(11),
107 `product_id` INT(11),
108 `quantity` INT(11),
109 `product_status` VARCHAR(100),
110 `date_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
111 PRIMARY KEY (`id`)
112);