forked from zacharski/irc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchat.sql
More file actions
52 lines (43 loc) · 1.39 KB
/
Copy pathchat.sql
File metadata and controls
52 lines (43 loc) · 1.39 KB
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
DROP DATABASE IF EXISTS chat;
CREATE DATABASE chat;
\c chat;
CREATE EXTENSION pgcrypto;
--
-- Table structure for table users
--
DROP TABLE IF EXISTS users;
CREATE TABLE users (
id serial NOT NULL,
username varchar(25) NOT NULL default '',
password varchar(300) NOT NULL default '',
PRIMARY KEY (id)
) ;
--
-- Putting data into the users table
--
INSERT INTO users (username, password) VALUES
('ryan', crypt('og123', gen_salt('bf'))),
('peter', crypt('laser', gen_salt('bf'))),
('ghost', crypt('spooky', gen_salt('bf'))),
('ghostbuster', crpyt('wygc', gen_salt('bf')));
--
-- Table structure for table messages
--
DROP TABLE IF EXISTS messages;
CREATE TABLE messages (
id serial NOT NULL,
text varchar(300) NOT NULL default '',
user_id int NOT NULL default '0',
PRIMARY KEY (id)
) ;
--
-- Putting data into the messages table
--
INSERT INTO messages (text, user_id) VALUES ('i wonder if we will pass this?', 1);
INSERT INTO messages (text, user_id) VALUES ('idk, man. this was really hard.', 2);
INSERT INTO messages (text, user_id) VALUES ('yeah, totally', 1);
INSERT INTO messages (text, user_id) VALUES ('you will never PASS!!!!', 3);
INSERT INTO messages (text, user_id) VALUES ('WTF', 2);
INSERT INTO messages (text, user_id) VALUES ('AHHHHHHHHHHHHH', 2);
INSERT INTO messages (text, user_id) VALUES ('RUN!!!', 1);
INSERT INTO messages (text, user_id) VALUES ('i aint afraid of no ghosts', 4);