File tree Expand file tree Collapse file tree 6 files changed +345
-39
lines changed Expand file tree Collapse file tree 6 files changed +345
-39
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ gem "rake"
5
5
gem "grape"
6
6
7
7
gem "grape-activerecord"
8
- gem "sqlite3 "
8
+ gem "pg "
9
9
10
10
gem "activeuuid"
11
11
Original file line number Diff line number Diff line change 84
84
passenger (5.0.16 )
85
85
rack
86
86
rake (>= 0.8.1 )
87
+ pg (0.18.3 )
87
88
powerpack (0.1.1 )
88
89
rack (1.5.5 )
89
90
rack-accept (0.4.5 )
120
121
json (~> 1.8 )
121
122
simplecov-html (~> 0.10.0 )
122
123
simplecov-html (0.10.0 )
123
- sqlite3 (1.3.10 )
124
124
thread_safe (0.3.5 )
125
125
tzinfo (1.2.2 )
126
126
thread_safe (~> 0.1 )
@@ -144,11 +144,14 @@ DEPENDENCIES
144
144
grape
145
145
grape-activerecord
146
146
passenger
147
+ pg
147
148
rack-test
148
149
rake
149
150
require_all
150
151
rspec
151
152
rubocop
152
153
simplecov
153
154
simplecov-summary !
154
- sqlite3
155
+
156
+ BUNDLED WITH
157
+ 1.10.6
Original file line number Diff line number Diff line change 1
1
development :
2
- adapter : sqlite3
3
- database : db/development.sqlite3
2
+ adapter : postgresql
3
+ encoding : unicode
4
+ database : mcmuch_development
5
+ pool : 5
4
6
5
7
test :
6
- adapter : sqlite3
7
- database : db/test.sqlite3
8
+ adapter : postgresql
9
+ encoding : unicode
10
+ database : mcmuch_test
11
+ pool : 5
8
12
9
13
production :
10
- adapter : sqlite3
11
- database : db/production.sqlite3
14
+ adapter : postgresql
15
+ encoding : unicode
16
+ database : mcmuch
17
+ pool : 5
Original file line number Diff line number Diff line change 10
10
require_all __dir__ + "/../models"
11
11
# require_all __dir__ + "/../helpers"
12
12
require_all __dir__ + "/../api"
13
-
14
- POSTGRE = ActiveRecord ::Base . connection . adapter_name . downcase == "postgresql"
Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ def change
3
3
create_table :users do |t |
4
4
t . uuid :mojang_uuid
5
5
6
- t . string :username
7
- t . string :role
6
+ t . text :username
7
+ t . text :role
8
8
9
9
t . datetime :created_at
10
10
t . datetime :last_login
@@ -14,10 +14,10 @@ def change
14
14
add_index :users , :username , unique : true
15
15
16
16
create_table :creations do |t |
17
- t . string :title
17
+ t . text :title
18
18
t . text :description
19
19
20
- t . string :visibility
20
+ t . text :visibility
21
21
22
22
t . belongs_to :user
23
23
end
@@ -26,28 +26,24 @@ def change
26
26
add_index :creations , :user_id
27
27
28
28
create_table :revisions do |t |
29
- t . column :sha1 , "binary(20)"
29
+ t . text :sha1
30
30
t . integer :filesize
31
31
32
32
t . belongs_to :creation
33
33
34
- t . string :title
34
+ t . text :title
35
35
36
- t . string :type
36
+ t . text :type
37
37
38
- if ::POSTGRE
39
- t . column :tags , "jsonb"
40
- else
41
- t . text :tags_json
42
- end
38
+ t . column :tags , "text[]"
43
39
44
40
t . datetime :created_at
45
41
end
46
42
47
43
add_index :revisions , :sha1 , unique : true
48
44
add_index :revisions , :creation_id
49
45
add_index :revisions , :type
50
- execute "ADD INDEX index_revisions_on_tags ON revisions USING gin (tags);" if :: POSTGRE
46
+ execute "CREATE INDEX index_revisions_on_tags ON revisions USING gin (tags);"
51
47
52
48
create_table :comments do |t |
53
49
t . belongs_to :user
You can’t perform that action at this time.
0 commit comments