-
Notifications
You must be signed in to change notification settings - Fork 0
/
user_form.sql
85 lines (71 loc) · 2.5 KB
/
user_form.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
-- Adminer 4.7.7 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP DATABASE IF EXISTS `user_form`;
CREATE DATABASE `user_form` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `user_form`;
DROP TABLE IF EXISTS `orders`;
CREATE TABLE `orders` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`first_name` varchar(255) NOT NULL,
`last_name` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`address` varchar(255) NOT NULL,
`address2` varchar(255) DEFAULT NULL,
`country` varchar(255) NOT NULL,
`state` varchar(255) NOT NULL,
`zipcode` varchar(255) DEFAULT NULL,
`total_price` float(6,2) NOT NULL DEFAULT '0.00',
`order_status` varchar(255) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `order_details`;
CREATE TABLE `order_details` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_id` int(11) DEFAULT NULL,
`product_id` int(11) DEFAULT NULL,
`product_name` varchar(50) DEFAULT NULL,
`product_price` float(6,2) DEFAULT NULL,
`qty` int(11) DEFAULT NULL,
`total_price` double(6,2) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `products`;
CREATE TABLE `products` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`product_name` varchar(255) DEFAULT NULL,
`product_slug` varchar(255) DEFAULT NULL,
`short_description` varchar(255) DEFAULT NULL,
`full_description` text,
`price` double(4,2) DEFAULT NULL,
`is_featured` tinyint(1) DEFAULT '0',
`is_active` tinyint(1) DEFAULT '0',
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `product_images`;
CREATE TABLE `product_images` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`product_id` int(11) DEFAULT NULL,
`img` varchar(255) DEFAULT NULL,
`display_order` int(11) DEFAULT NULL,
`is_featured` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
SET NAMES utf8mb4;
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(100) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL DEFAULT '0',
`email` varchar(100) NOT NULL DEFAULT '0',
`password` varchar(100) NOT NULL DEFAULT '0',
`user_type` varchar(20) NOT NULL DEFAULT 'user',
`image` varchar(100) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- 2023-01-11 12:11:12