Revize 33cc792c
Přidáno uživatelem Tomáš Šimandl před asi 6 roky(ů)
sources/create_table.sql | ||
---|---|---|
1 |
-- phpMyAdmin SQL Dump |
|
2 |
-- version 4.4.14 |
|
3 |
-- http://www.phpmyadmin.net |
|
4 |
-- |
|
5 |
-- Počítač: 127.0.0.1 |
|
6 |
-- Vytvořeno: Stř 11. kvě 2016, 16:08 |
|
7 |
-- Verze serveru: 5.6.26 |
|
8 |
-- Verze PHP: 5.6.12 |
|
1 |
|
|
9 | 2 |
|
10 | 3 |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; |
11 | 4 |
SET time_zone = "+00:00"; |
12 | 5 |
|
13 |
|
|
14 |
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; |
|
15 |
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; |
|
16 |
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; |
|
17 |
/*!40101 SET NAMES utf8mb4 */; |
|
18 |
|
|
19 | 6 |
-- |
20 | 7 |
-- Databáze: `visualization_tool` |
21 | 8 |
-- |
22 | 9 |
|
23 | 10 |
-- -------------------------------------------------------- |
24 | 11 |
|
25 |
-- |
|
26 |
-- Struktura tabulky `diagram` |
|
27 |
-- |
|
28 |
|
|
29 |
CREATE TABLE IF NOT EXISTS `diagram` ( |
|
30 |
`id` int(11) NOT NULL, |
|
31 |
`name` varchar(255) COLLATE utf8_czech_ci NOT NULL, |
|
32 |
`created` datetime NOT NULL, |
|
33 |
`last_update` datetime NOT NULL, |
|
34 |
`user_id` int(11) NOT NULL, |
|
35 |
`public` tinyint(1) NOT NULL DEFAULT '0', |
|
36 |
`graph_json` text COLLATE utf8_czech_ci NOT NULL DEFAULT '' |
|
37 |
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; |
|
38 |
|
|
39 |
-- -------------------------------------------------------- |
|
40 |
|
|
41 | 12 |
-- |
42 | 13 |
-- Struktura tabulky `user` |
43 | 14 |
-- |
44 | 15 |
|
45 | 16 |
CREATE TABLE IF NOT EXISTS `user` ( |
46 |
`id` int(11) NOT NULL, |
|
17 |
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
47 | 18 |
`nick` varchar(50) COLLATE utf8_czech_ci NOT NULL, |
48 | 19 |
`name` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '', |
49 | 20 |
`psw` varchar(32) COLLATE utf8_czech_ci NOT NULL, |
50 | 21 |
`session` varchar(50) COLLATE utf8_czech_ci NOT NULL, |
51 | 22 |
`active` tinyint(1) NOT NULL, |
52 | 23 |
`created` datetime NOT NULL, |
53 |
`email` varchar(50) COLLATE utf8_czech_ci NOT NULL |
|
54 |
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; |
|
24 |
`email` varchar(50) COLLATE utf8_czech_ci NOT NULL, |
|
25 |
CONSTRAINT PK_user PRIMARY KEY (`id`) |
|
26 |
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; |
|
55 | 27 |
|
56 |
|
|
57 |
-- |
|
58 |
-- Klíče pro exportované tabulky |
|
59 | 28 |
-- |
60 |
|
|
61 |
-- |
|
62 |
-- Klíče pro tabulku `diagram` |
|
63 |
-- |
|
64 |
ALTER TABLE `diagram` |
|
65 |
ADD PRIMARY KEY (`id`); |
|
66 |
|
|
67 |
-- |
|
68 |
-- Klíče pro tabulku `user` |
|
29 |
-- Struktura tabulky `diagram` |
|
69 | 30 |
-- |
70 |
ALTER TABLE `user` |
|
71 |
ADD PRIMARY KEY (`id`); |
|
72 | 31 |
|
73 |
-- |
|
74 |
-- AUTO_INCREMENT pro tabulky |
|
75 |
-- |
|
32 |
CREATE TABLE IF NOT EXISTS `diagram` ( |
|
33 |
`id` int(11) NOT NULL AUTO_INCREMENT, |
|
34 |
`name` varchar(255) COLLATE utf8_czech_ci NOT NULL, |
|
35 |
`created` datetime NOT NULL, |
|
36 |
`last_update` datetime NOT NULL, |
|
37 |
`user_id` int(11) NOT NULL, |
|
38 |
`public` tinyint(1) NOT NULL DEFAULT '0', |
|
39 |
`graph_json` text COLLATE utf8_czech_ci NOT NULL DEFAULT '', |
|
40 |
CONSTRAINT PK_diagram PRIMARY KEY (`id`), |
|
41 |
CONSTRAINT FK_user_diagram FOREIGN KEY (`user_id`) REFERENCES user(`id`) |
|
42 |
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; |
|
76 | 43 |
|
77 |
-- |
|
78 |
-- AUTO_INCREMENT pro tabulku `diagram` |
|
79 |
-- |
|
80 |
ALTER TABLE `diagram` |
|
81 |
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2; |
|
82 |
-- |
|
83 |
-- AUTO_INCREMENT pro tabulku `user` |
|
84 |
-- |
|
85 |
ALTER TABLE `user` |
|
86 |
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2; |
|
87 |
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; |
|
88 |
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; |
|
89 |
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
Také k dispozici: Unified diff
Cleaned sql create table script