-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.rb
56 lines (53 loc) · 1.58 KB
/
init.rb
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
require './local_sequel'
DB.create_table :users do
primary_key :id
String :username
String :pass #md5
String :email
String :emailver #code to verify email
String :rest, :default => "" #HASHED reset code for reseting password.
Integer :auth, :default => 0
String :subs, :default => ""
String :hist, :default => ""
TrueClass :veri, :default => false
Time :ban, :default => Time.at(0)
#String :vparas, :default => ""
#String :vbooks, :default => ""
#String :vnames, :default => ""
String :other, :default => ""
end
DB.create_table :paras do
primary_key :id
Integer :bookid
Integer :userid
String :an #author's note
String :text #actual paragraph text
String :chapname
String :upvotes ,:default => "" #Integer :upvotes
String :downvotes,:default => "" #Integer :downvotes
TrueClass :newchap ,:default => false
TrueClass :endchap ,:default => false
#Integer :chapnum
end
DB.create_table :books do
primary_key :id
Integer :userid
Time :timestamp
String :pparas, :default => ""
String :paras, :default => ""
TrueClass :finished, :default => false
String :endvotes #Integer :endvotes, :default => 0
String :noendvotes #Integer :noendvotes,:default => 0
String :upvotes #added after; for when book is finished
String :downvotes #see ^
Integer :numend, :default => 99
String :name, :default => ""
end
DB.create_table :names do
primary_key :id
String :name
Integer :bookid
Integer :userid
String :upvotes #Integer :upvotes ,:default => 0
String :downvotes #Integer :downvoted ,:default => 0
end