-
Notifications
You must be signed in to change notification settings - Fork 18
/
database_schema.v1.4.sql
executable file
·44 lines (36 loc) · 1.28 KB
/
database_schema.v1.4.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
-- --------------------------------------------------------
-- Author: Waldir Bertazzi Junior
-- Version: 1.4
-- --------------------------------------------------------
-- --------------------------------------------------------
--
-- Table structure for table `users_meta`
--
CREATE TABLE IF NOT EXISTS `users_meta` (
`user_id` mediumint(8) NOT NULL,
`name` varchar(40) NOT NULL,
`value` varchar(255) NOT NULL,
KEY `user_id` (`user_id`),
KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users_meta`
--
INSERT INTO `users_meta` (`user_id`, `name`, `value`) VALUES
(1, 'adress_street', 'Wall Street'),
(1, 'address_number', '134'),
(1, 'street_state', 'NY');
--
-- Constraints for dumped tables
--
--
-- Constraints for table `users_meta`
--
ALTER TABLE `users_meta`
ADD CONSTRAINT `users_meta_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;
--
-- Constraints for table `users_permissions`
--
ALTER TABLE `users_permissions`
ADD CONSTRAINT `users_permissions_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION,
ADD CONSTRAINT `users_permissions_ibfk_2` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;