# Conflicts: # db/seeds.rb # public/react/src/modules/tpm/NewHeader.js # public/react/src/modules/user/usersInfo/InfosBanner.jsdev_local_2
commit
cafe91bfab
@ -1,413 +1,413 @@
|
|||||||
PATH
|
PATH
|
||||||
remote: lib/gitlab-cli
|
remote: lib/gitlab-cli
|
||||||
specs:
|
specs:
|
||||||
gitlab (3.2.0)
|
gitlab (3.2.0)
|
||||||
httparty
|
httparty
|
||||||
terminal-table
|
terminal-table
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: https://gems.ruby-china.com/
|
remote: https://gems.ruby-china.com/
|
||||||
specs:
|
specs:
|
||||||
aasm (5.0.5)
|
aasm (5.0.5)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
actioncable (5.2.1)
|
actioncable (5.2.1)
|
||||||
actionpack (= 5.2.1)
|
actionpack (= 5.2.1)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
websocket-driver (>= 0.6.1)
|
websocket-driver (>= 0.6.1)
|
||||||
actionmailer (5.2.1)
|
actionmailer (5.2.1)
|
||||||
actionpack (= 5.2.1)
|
actionpack (= 5.2.1)
|
||||||
actionview (= 5.2.1)
|
actionview (= 5.2.1)
|
||||||
activejob (= 5.2.1)
|
activejob (= 5.2.1)
|
||||||
mail (~> 2.5, >= 2.5.4)
|
mail (~> 2.5, >= 2.5.4)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
actionpack (5.2.1)
|
actionpack (5.2.1)
|
||||||
actionview (= 5.2.1)
|
actionview (= 5.2.1)
|
||||||
activesupport (= 5.2.1)
|
activesupport (= 5.2.1)
|
||||||
rack (~> 2.0)
|
rack (~> 2.0)
|
||||||
rack-test (>= 0.6.3)
|
rack-test (>= 0.6.3)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||||
actionview (5.2.1)
|
actionview (5.2.1)
|
||||||
activesupport (= 5.2.1)
|
activesupport (= 5.2.1)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
erubi (~> 1.4)
|
erubi (~> 1.4)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
||||||
active_decorator (1.2.0)
|
active_decorator (1.2.0)
|
||||||
activejob (5.2.1)
|
activejob (5.2.1)
|
||||||
activesupport (= 5.2.1)
|
activesupport (= 5.2.1)
|
||||||
globalid (>= 0.3.6)
|
globalid (>= 0.3.6)
|
||||||
activemodel (5.2.1)
|
activemodel (5.2.1)
|
||||||
activesupport (= 5.2.1)
|
activesupport (= 5.2.1)
|
||||||
activerecord (5.2.1)
|
activerecord (5.2.1)
|
||||||
activemodel (= 5.2.1)
|
activemodel (= 5.2.1)
|
||||||
activesupport (= 5.2.1)
|
activesupport (= 5.2.1)
|
||||||
arel (>= 9.0)
|
arel (>= 9.0)
|
||||||
activestorage (5.2.1)
|
activestorage (5.2.1)
|
||||||
actionpack (= 5.2.1)
|
actionpack (= 5.2.1)
|
||||||
activerecord (= 5.2.1)
|
activerecord (= 5.2.1)
|
||||||
marcel (~> 0.3.1)
|
marcel (~> 0.3.1)
|
||||||
activesupport (5.2.1)
|
activesupport (5.2.1)
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
i18n (>= 0.7, < 2)
|
i18n (>= 0.7, < 2)
|
||||||
minitest (~> 5.1)
|
minitest (~> 5.1)
|
||||||
tzinfo (~> 1.1)
|
tzinfo (~> 1.1)
|
||||||
acts-as-taggable-on (6.0.0)
|
acts-as-taggable-on (6.0.0)
|
||||||
activerecord (~> 5.0)
|
activerecord (~> 5.0)
|
||||||
addressable (2.5.2)
|
addressable (2.5.2)
|
||||||
public_suffix (>= 2.0.2, < 4.0)
|
public_suffix (>= 2.0.2, < 4.0)
|
||||||
archive-zip (0.11.0)
|
archive-zip (0.11.0)
|
||||||
io-like (~> 0.3.0)
|
io-like (~> 0.3.0)
|
||||||
arel (9.0.0)
|
arel (9.0.0)
|
||||||
autoprefixer-rails (9.6.1)
|
autoprefixer-rails (9.6.1)
|
||||||
execjs
|
execjs
|
||||||
awesome_print (1.8.0)
|
awesome_print (1.8.0)
|
||||||
axlsx (3.0.0.pre)
|
axlsx (3.0.0.pre)
|
||||||
htmlentities (~> 4.3, >= 4.3.4)
|
htmlentities (~> 4.3, >= 4.3.4)
|
||||||
mimemagic (~> 0.3)
|
mimemagic (~> 0.3)
|
||||||
nokogiri (~> 1.8, >= 1.8.2)
|
nokogiri (~> 1.8, >= 1.8.2)
|
||||||
rubyzip (~> 1.2, >= 1.2.1)
|
rubyzip (~> 1.2, >= 1.2.1)
|
||||||
axlsx_rails (0.5.2)
|
axlsx_rails (0.5.2)
|
||||||
actionpack (>= 3.1)
|
actionpack (>= 3.1)
|
||||||
axlsx (>= 2.0.1)
|
axlsx (>= 2.0.1)
|
||||||
bindex (0.5.0)
|
bindex (0.5.0)
|
||||||
bootsnap (1.3.1)
|
bootsnap (1.3.1)
|
||||||
msgpack (~> 1.0)
|
msgpack (~> 1.0)
|
||||||
bootstrap (4.3.1)
|
bootstrap (4.3.1)
|
||||||
autoprefixer-rails (>= 9.1.0)
|
autoprefixer-rails (>= 9.1.0)
|
||||||
popper_js (>= 1.14.3, < 2)
|
popper_js (>= 1.14.3, < 2)
|
||||||
sassc-rails (>= 2.0.0)
|
sassc-rails (>= 2.0.0)
|
||||||
builder (3.2.3)
|
builder (3.2.3)
|
||||||
bulk_insert (1.7.0)
|
bulk_insert (1.7.0)
|
||||||
activerecord (>= 3.2.0)
|
activerecord (>= 3.2.0)
|
||||||
byebug (10.0.2)
|
byebug (10.0.2)
|
||||||
capybara (3.5.1)
|
capybara (3.5.1)
|
||||||
addressable
|
addressable
|
||||||
mini_mime (>= 0.1.3)
|
mini_mime (>= 0.1.3)
|
||||||
nokogiri (~> 1.8)
|
nokogiri (~> 1.8)
|
||||||
rack (>= 1.6.0)
|
rack (>= 1.6.0)
|
||||||
rack-test (>= 0.6.3)
|
rack-test (>= 0.6.3)
|
||||||
xpath (~> 3.1)
|
xpath (~> 3.1)
|
||||||
childprocess (0.9.0)
|
childprocess (0.9.0)
|
||||||
ffi (~> 1.0, >= 1.0.11)
|
ffi (~> 1.0, >= 1.0.11)
|
||||||
chromedriver-helper (1.2.0)
|
chromedriver-helper (1.2.0)
|
||||||
archive-zip (~> 0.10)
|
archive-zip (~> 0.10)
|
||||||
nokogiri (~> 1.8)
|
nokogiri (~> 1.8)
|
||||||
chunky_png (1.3.10)
|
chunky_png (1.3.10)
|
||||||
concurrent-ruby (1.0.5)
|
concurrent-ruby (1.0.5)
|
||||||
connection_pool (2.2.2)
|
connection_pool (2.2.2)
|
||||||
crass (1.0.4)
|
crass (1.0.4)
|
||||||
diff-lcs (1.3)
|
diff-lcs (1.3)
|
||||||
elasticsearch (7.2.0)
|
elasticsearch (7.2.0)
|
||||||
elasticsearch-api (= 7.2.0)
|
elasticsearch-api (= 7.2.0)
|
||||||
elasticsearch-transport (= 7.2.0)
|
elasticsearch-transport (= 7.2.0)
|
||||||
elasticsearch-api (7.2.0)
|
elasticsearch-api (7.2.0)
|
||||||
multi_json
|
multi_json
|
||||||
elasticsearch-transport (7.2.0)
|
elasticsearch-transport (7.2.0)
|
||||||
faraday
|
faraday
|
||||||
multi_json
|
multi_json
|
||||||
erubi (1.7.1)
|
erubi (1.7.1)
|
||||||
execjs (2.7.0)
|
execjs (2.7.0)
|
||||||
faraday (0.15.4)
|
faraday (0.15.4)
|
||||||
multipart-post (>= 1.2, < 3)
|
multipart-post (>= 1.2, < 3)
|
||||||
ffi (1.9.25)
|
ffi (1.9.25)
|
||||||
font-awesome-sass (4.7.0)
|
font-awesome-sass (4.7.0)
|
||||||
sass (>= 3.2)
|
sass (>= 3.2)
|
||||||
globalid (0.4.1)
|
globalid (0.4.1)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
grape-entity (0.7.1)
|
grape-entity (0.7.1)
|
||||||
activesupport (>= 4.0)
|
activesupport (>= 4.0)
|
||||||
multi_json (>= 1.3.2)
|
multi_json (>= 1.3.2)
|
||||||
hashie (3.6.0)
|
hashie (3.6.0)
|
||||||
htmlentities (4.3.4)
|
htmlentities (4.3.4)
|
||||||
httparty (0.16.2)
|
httparty (0.16.2)
|
||||||
multi_xml (>= 0.5.2)
|
multi_xml (>= 0.5.2)
|
||||||
i18n (1.1.0)
|
i18n (1.1.0)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
io-like (0.3.0)
|
io-like (0.3.0)
|
||||||
jbuilder (2.7.0)
|
jbuilder (2.7.0)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
multi_json (>= 1.2)
|
multi_json (>= 1.2)
|
||||||
jquery-rails (4.3.5)
|
jquery-rails (4.3.5)
|
||||||
rails-dom-testing (>= 1, < 3)
|
rails-dom-testing (>= 1, < 3)
|
||||||
railties (>= 4.2.0)
|
railties (>= 4.2.0)
|
||||||
thor (>= 0.14, < 2.0)
|
thor (>= 0.14, < 2.0)
|
||||||
jwt (2.1.0)
|
jwt (2.1.0)
|
||||||
kaminari (1.1.1)
|
kaminari (1.1.1)
|
||||||
activesupport (>= 4.1.0)
|
activesupport (>= 4.1.0)
|
||||||
kaminari-actionview (= 1.1.1)
|
kaminari-actionview (= 1.1.1)
|
||||||
kaminari-activerecord (= 1.1.1)
|
kaminari-activerecord (= 1.1.1)
|
||||||
kaminari-core (= 1.1.1)
|
kaminari-core (= 1.1.1)
|
||||||
kaminari-actionview (1.1.1)
|
kaminari-actionview (1.1.1)
|
||||||
actionview
|
actionview
|
||||||
kaminari-core (= 1.1.1)
|
kaminari-core (= 1.1.1)
|
||||||
kaminari-activerecord (1.1.1)
|
kaminari-activerecord (1.1.1)
|
||||||
activerecord
|
activerecord
|
||||||
kaminari-core (= 1.1.1)
|
kaminari-core (= 1.1.1)
|
||||||
kaminari-core (1.1.1)
|
kaminari-core (1.1.1)
|
||||||
listen (3.1.5)
|
listen (3.1.5)
|
||||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
||||||
rb-inotify (~> 0.9, >= 0.9.7)
|
rb-inotify (~> 0.9, >= 0.9.7)
|
||||||
ruby_dep (~> 1.2)
|
ruby_dep (~> 1.2)
|
||||||
loofah (2.2.2)
|
loofah (2.2.2)
|
||||||
crass (~> 1.0.2)
|
crass (~> 1.0.2)
|
||||||
nokogiri (>= 1.5.9)
|
nokogiri (>= 1.5.9)
|
||||||
mail (2.7.0)
|
mail (2.7.0)
|
||||||
mini_mime (>= 0.1.1)
|
mini_mime (>= 0.1.1)
|
||||||
marcel (0.3.2)
|
marcel (0.3.2)
|
||||||
mimemagic (~> 0.3.2)
|
mimemagic (~> 0.3.2)
|
||||||
method_source (0.9.0)
|
method_source (0.9.0)
|
||||||
mimemagic (0.3.2)
|
mimemagic (0.3.2)
|
||||||
mini_mime (1.0.0)
|
mini_mime (1.0.0)
|
||||||
mini_portile2 (2.3.0)
|
mini_portile2 (2.3.0)
|
||||||
minitest (5.11.3)
|
minitest (5.11.3)
|
||||||
msgpack (1.2.4)
|
msgpack (1.2.4)
|
||||||
multi_json (1.13.1)
|
multi_json (1.13.1)
|
||||||
multi_xml (0.6.0)
|
multi_xml (0.6.0)
|
||||||
multipart-post (2.0.0)
|
multipart-post (2.0.0)
|
||||||
mustermann (1.0.3)
|
mustermann (1.0.3)
|
||||||
mysql2 (0.5.2)
|
mysql2 (0.5.2)
|
||||||
nio4r (2.3.1)
|
nio4r (2.3.1)
|
||||||
nokogiri (1.8.4)
|
nokogiri (1.8.4)
|
||||||
mini_portile2 (~> 2.3.0)
|
mini_portile2 (~> 2.3.0)
|
||||||
oauth2 (1.4.1)
|
oauth2 (1.4.1)
|
||||||
faraday (>= 0.8, < 0.16.0)
|
faraday (>= 0.8, < 0.16.0)
|
||||||
jwt (>= 1.0, < 3.0)
|
jwt (>= 1.0, < 3.0)
|
||||||
multi_json (~> 1.3)
|
multi_json (~> 1.3)
|
||||||
multi_xml (~> 0.5)
|
multi_xml (~> 0.5)
|
||||||
rack (>= 1.2, < 3)
|
rack (>= 1.2, < 3)
|
||||||
pdfkit (0.8.4.1)
|
pdfkit (0.8.4.1)
|
||||||
popper_js (1.14.5)
|
popper_js (1.14.5)
|
||||||
public_suffix (3.0.2)
|
public_suffix (3.0.2)
|
||||||
puma (3.12.0)
|
puma (3.12.0)
|
||||||
rack (2.0.5)
|
rack (2.0.5)
|
||||||
rack-cors (1.0.2)
|
rack-cors (1.0.2)
|
||||||
rack-protection (2.0.5)
|
rack-protection (2.0.5)
|
||||||
rack
|
rack
|
||||||
rack-test (1.1.0)
|
rack-test (1.1.0)
|
||||||
rack (>= 1.0, < 3)
|
rack (>= 1.0, < 3)
|
||||||
rails (5.2.1)
|
rails (5.2.1)
|
||||||
actioncable (= 5.2.1)
|
actioncable (= 5.2.1)
|
||||||
actionmailer (= 5.2.1)
|
actionmailer (= 5.2.1)
|
||||||
actionpack (= 5.2.1)
|
actionpack (= 5.2.1)
|
||||||
actionview (= 5.2.1)
|
actionview (= 5.2.1)
|
||||||
activejob (= 5.2.1)
|
activejob (= 5.2.1)
|
||||||
activemodel (= 5.2.1)
|
activemodel (= 5.2.1)
|
||||||
activerecord (= 5.2.1)
|
activerecord (= 5.2.1)
|
||||||
activestorage (= 5.2.1)
|
activestorage (= 5.2.1)
|
||||||
activesupport (= 5.2.1)
|
activesupport (= 5.2.1)
|
||||||
bundler (>= 1.3.0)
|
bundler (>= 1.3.0)
|
||||||
railties (= 5.2.1)
|
railties (= 5.2.1)
|
||||||
sprockets-rails (>= 2.0.0)
|
sprockets-rails (>= 2.0.0)
|
||||||
rails-dom-testing (2.0.3)
|
rails-dom-testing (2.0.3)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
nokogiri (>= 1.6)
|
nokogiri (>= 1.6)
|
||||||
rails-html-sanitizer (1.0.4)
|
rails-html-sanitizer (1.0.4)
|
||||||
loofah (~> 2.2, >= 2.2.2)
|
loofah (~> 2.2, >= 2.2.2)
|
||||||
rails-i18n (5.1.3)
|
rails-i18n (5.1.3)
|
||||||
i18n (>= 0.7, < 2)
|
i18n (>= 0.7, < 2)
|
||||||
railties (>= 5.0, < 6)
|
railties (>= 5.0, < 6)
|
||||||
railties (5.2.1)
|
railties (5.2.1)
|
||||||
actionpack (= 5.2.1)
|
actionpack (= 5.2.1)
|
||||||
activesupport (= 5.2.1)
|
activesupport (= 5.2.1)
|
||||||
method_source
|
method_source
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
thor (>= 0.19.0, < 2.0)
|
thor (>= 0.19.0, < 2.0)
|
||||||
rake (12.3.1)
|
rake (12.3.1)
|
||||||
rb-fsevent (0.10.3)
|
rb-fsevent (0.10.3)
|
||||||
rb-inotify (0.9.10)
|
rb-inotify (0.9.10)
|
||||||
ffi (>= 0.5.0, < 2)
|
ffi (>= 0.5.0, < 2)
|
||||||
rchardet (1.8.0)
|
rchardet (1.8.0)
|
||||||
redcarpet (3.4.0)
|
redcarpet (3.4.0)
|
||||||
redis (4.1.0)
|
redis (4.1.0)
|
||||||
redis-actionpack (5.0.2)
|
redis-actionpack (5.0.2)
|
||||||
actionpack (>= 4.0, < 6)
|
actionpack (>= 4.0, < 6)
|
||||||
redis-rack (>= 1, < 3)
|
redis-rack (>= 1, < 3)
|
||||||
redis-store (>= 1.1.0, < 2)
|
redis-store (>= 1.1.0, < 2)
|
||||||
redis-activesupport (5.0.7)
|
redis-activesupport (5.0.7)
|
||||||
activesupport (>= 3, < 6)
|
activesupport (>= 3, < 6)
|
||||||
redis-store (>= 1.3, < 2)
|
redis-store (>= 1.3, < 2)
|
||||||
redis-rack (2.0.5)
|
redis-rack (2.0.5)
|
||||||
rack (>= 1.5, < 3)
|
rack (>= 1.5, < 3)
|
||||||
redis-store (>= 1.2, < 2)
|
redis-store (>= 1.2, < 2)
|
||||||
redis-rails (5.0.2)
|
redis-rails (5.0.2)
|
||||||
redis-actionpack (>= 5.0, < 6)
|
redis-actionpack (>= 5.0, < 6)
|
||||||
redis-activesupport (>= 5.0, < 6)
|
redis-activesupport (>= 5.0, < 6)
|
||||||
redis-store (>= 1.2, < 2)
|
redis-store (>= 1.2, < 2)
|
||||||
redis-store (1.6.0)
|
redis-store (1.6.0)
|
||||||
redis (>= 2.2, < 5)
|
redis (>= 2.2, < 5)
|
||||||
roo (2.8.2)
|
roo (2.8.2)
|
||||||
nokogiri (~> 1)
|
nokogiri (~> 1)
|
||||||
rubyzip (>= 1.2.1, < 2.0.0)
|
rubyzip (>= 1.2.1, < 2.0.0)
|
||||||
roo-xls (1.2.0)
|
roo-xls (1.2.0)
|
||||||
nokogiri
|
nokogiri
|
||||||
roo (>= 2.0.0, < 3)
|
roo (>= 2.0.0, < 3)
|
||||||
spreadsheet (> 0.9.0)
|
spreadsheet (> 0.9.0)
|
||||||
rqrcode (0.10.1)
|
rqrcode (0.10.1)
|
||||||
chunky_png (~> 1.0)
|
chunky_png (~> 1.0)
|
||||||
rqrcode_png (0.1.5)
|
rqrcode_png (0.1.5)
|
||||||
chunky_png
|
chunky_png
|
||||||
rqrcode
|
rqrcode
|
||||||
rspec-core (3.8.0)
|
rspec-core (3.8.0)
|
||||||
rspec-support (~> 3.8.0)
|
rspec-support (~> 3.8.0)
|
||||||
rspec-expectations (3.8.1)
|
rspec-expectations (3.8.1)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.8.0)
|
rspec-support (~> 3.8.0)
|
||||||
rspec-mocks (3.8.0)
|
rspec-mocks (3.8.0)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.8.0)
|
rspec-support (~> 3.8.0)
|
||||||
rspec-rails (3.8.0)
|
rspec-rails (3.8.0)
|
||||||
actionpack (>= 3.0)
|
actionpack (>= 3.0)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
railties (>= 3.0)
|
railties (>= 3.0)
|
||||||
rspec-core (~> 3.8.0)
|
rspec-core (~> 3.8.0)
|
||||||
rspec-expectations (~> 3.8.0)
|
rspec-expectations (~> 3.8.0)
|
||||||
rspec-mocks (~> 3.8.0)
|
rspec-mocks (~> 3.8.0)
|
||||||
rspec-support (~> 3.8.0)
|
rspec-support (~> 3.8.0)
|
||||||
rspec-support (3.8.0)
|
rspec-support (3.8.0)
|
||||||
ruby-ole (1.2.12.2)
|
ruby-ole (1.2.12.2)
|
||||||
ruby_dep (1.5.0)
|
ruby_dep (1.5.0)
|
||||||
rubyzip (1.2.1)
|
rubyzip (1.2.1)
|
||||||
sass (3.5.7)
|
sass (3.5.7)
|
||||||
sass-listen (~> 4.0.0)
|
sass-listen (~> 4.0.0)
|
||||||
sass-listen (4.0.0)
|
sass-listen (4.0.0)
|
||||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
||||||
rb-inotify (~> 0.9, >= 0.9.7)
|
rb-inotify (~> 0.9, >= 0.9.7)
|
||||||
sass-rails (5.0.7)
|
sass-rails (5.0.7)
|
||||||
railties (>= 4.0.0, < 6)
|
railties (>= 4.0.0, < 6)
|
||||||
sass (~> 3.1)
|
sass (~> 3.1)
|
||||||
sprockets (>= 2.8, < 4.0)
|
sprockets (>= 2.8, < 4.0)
|
||||||
sprockets-rails (>= 2.0, < 4.0)
|
sprockets-rails (>= 2.0, < 4.0)
|
||||||
tilt (>= 1.1, < 3)
|
tilt (>= 1.1, < 3)
|
||||||
sassc (2.0.1)
|
sassc (2.0.1)
|
||||||
ffi (~> 1.9)
|
ffi (~> 1.9)
|
||||||
rake
|
rake
|
||||||
sassc-rails (2.1.2)
|
sassc-rails (2.1.2)
|
||||||
railties (>= 4.0.0)
|
railties (>= 4.0.0)
|
||||||
sassc (>= 2.0)
|
sassc (>= 2.0)
|
||||||
sprockets (> 3.0)
|
sprockets (> 3.0)
|
||||||
sprockets-rails
|
sprockets-rails
|
||||||
tilt
|
tilt
|
||||||
searchkick (3.1.3)
|
searchkick (3.1.3)
|
||||||
activemodel (>= 4.2)
|
activemodel (>= 4.2)
|
||||||
elasticsearch (>= 5)
|
elasticsearch (>= 5)
|
||||||
hashie
|
hashie
|
||||||
selenium-webdriver (3.14.0)
|
selenium-webdriver (3.14.0)
|
||||||
childprocess (~> 0.5)
|
childprocess (~> 0.5)
|
||||||
rubyzip (~> 1.2)
|
rubyzip (~> 1.2)
|
||||||
sidekiq (5.2.7)
|
sidekiq (5.2.7)
|
||||||
connection_pool (~> 2.2, >= 2.2.2)
|
connection_pool (~> 2.2, >= 2.2.2)
|
||||||
rack (>= 1.5.0)
|
rack (>= 1.5.0)
|
||||||
rack-protection (>= 1.5.0)
|
rack-protection (>= 1.5.0)
|
||||||
redis (>= 3.3.5, < 5)
|
redis (>= 3.3.5, < 5)
|
||||||
simple_form (4.1.0)
|
simple_form (4.1.0)
|
||||||
actionpack (>= 5.0)
|
actionpack (>= 5.0)
|
||||||
activemodel (>= 5.0)
|
activemodel (>= 5.0)
|
||||||
simple_xlsx_reader (1.0.4)
|
simple_xlsx_reader (1.0.4)
|
||||||
nokogiri
|
nokogiri
|
||||||
rubyzip
|
rubyzip
|
||||||
sinatra (2.0.5)
|
sinatra (2.0.5)
|
||||||
mustermann (~> 1.0)
|
mustermann (~> 1.0)
|
||||||
rack (~> 2.0)
|
rack (~> 2.0)
|
||||||
rack-protection (= 2.0.5)
|
rack-protection (= 2.0.5)
|
||||||
tilt (~> 2.0)
|
tilt (~> 2.0)
|
||||||
spreadsheet (1.2.3)
|
spreadsheet (1.2.3)
|
||||||
ruby-ole (>= 1.0)
|
ruby-ole (>= 1.0)
|
||||||
spring (2.0.2)
|
spring (2.0.2)
|
||||||
activesupport (>= 4.2)
|
activesupport (>= 4.2)
|
||||||
spring-watcher-listen (2.0.1)
|
spring-watcher-listen (2.0.1)
|
||||||
listen (>= 2.7, < 4.0)
|
listen (>= 2.7, < 4.0)
|
||||||
spring (>= 1.2, < 3.0)
|
spring (>= 1.2, < 3.0)
|
||||||
sprockets (3.7.2)
|
sprockets (3.7.2)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
rack (> 1, < 3)
|
rack (> 1, < 3)
|
||||||
sprockets-rails (3.2.1)
|
sprockets-rails (3.2.1)
|
||||||
actionpack (>= 4.0)
|
actionpack (>= 4.0)
|
||||||
activesupport (>= 4.0)
|
activesupport (>= 4.0)
|
||||||
sprockets (>= 3.0.0)
|
sprockets (>= 3.0.0)
|
||||||
terminal-table (1.8.0)
|
terminal-table (1.8.0)
|
||||||
unicode-display_width (~> 1.1, >= 1.1.1)
|
unicode-display_width (~> 1.1, >= 1.1.1)
|
||||||
thor (0.20.0)
|
thor (0.20.0)
|
||||||
thread_safe (0.3.6)
|
thread_safe (0.3.6)
|
||||||
tilt (2.0.8)
|
tilt (2.0.8)
|
||||||
turbolinks (5.2.0)
|
turbolinks (5.2.0)
|
||||||
turbolinks-source (~> 5.2)
|
turbolinks-source (~> 5.2)
|
||||||
turbolinks-source (5.2.0)
|
turbolinks-source (5.2.0)
|
||||||
tzinfo (1.2.5)
|
tzinfo (1.2.5)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
uglifier (4.1.17)
|
uglifier (4.1.17)
|
||||||
execjs (>= 0.3.0, < 3)
|
execjs (>= 0.3.0, < 3)
|
||||||
unicode-display_width (1.4.0)
|
unicode-display_width (1.4.0)
|
||||||
web-console (3.6.2)
|
web-console (3.6.2)
|
||||||
actionview (>= 5.0)
|
actionview (>= 5.0)
|
||||||
activemodel (>= 5.0)
|
activemodel (>= 5.0)
|
||||||
bindex (>= 0.4.0)
|
bindex (>= 0.4.0)
|
||||||
railties (>= 5.0)
|
railties (>= 5.0)
|
||||||
websocket-driver (0.7.0)
|
websocket-driver (0.7.0)
|
||||||
websocket-extensions (>= 0.1.0)
|
websocket-extensions (>= 0.1.0)
|
||||||
websocket-extensions (0.1.3)
|
websocket-extensions (0.1.3)
|
||||||
wkhtmltopdf-binary (0.12.4)
|
wkhtmltopdf-binary (0.12.4)
|
||||||
xpath (3.1.0)
|
xpath (3.1.0)
|
||||||
nokogiri (~> 1.8)
|
nokogiri (~> 1.8)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
aasm
|
aasm
|
||||||
active_decorator
|
active_decorator
|
||||||
acts-as-taggable-on (~> 6.0)
|
acts-as-taggable-on (~> 6.0)
|
||||||
awesome_print
|
awesome_print
|
||||||
axlsx (~> 3.0.0.pre)
|
axlsx (~> 3.0.0.pre)
|
||||||
axlsx_rails (~> 0.5.2)
|
axlsx_rails (~> 0.5.2)
|
||||||
bootsnap (>= 1.1.0)
|
bootsnap (>= 1.1.0)
|
||||||
bootstrap (~> 4.3.1)
|
bootstrap (~> 4.3.1)
|
||||||
bulk_insert
|
bulk_insert
|
||||||
byebug
|
byebug
|
||||||
capybara (>= 2.15, < 4.0)
|
capybara (>= 2.15, < 4.0)
|
||||||
chromedriver-helper
|
chromedriver-helper
|
||||||
faraday (~> 0.15.4)
|
faraday (~> 0.15.4)
|
||||||
font-awesome-sass (= 4.7.0)
|
font-awesome-sass (= 4.7.0)
|
||||||
gitlab!
|
gitlab!
|
||||||
grape-entity (~> 0.7.1)
|
grape-entity (~> 0.7.1)
|
||||||
jbuilder (~> 2.5)
|
jbuilder (~> 2.5)
|
||||||
jquery-rails
|
jquery-rails
|
||||||
kaminari (~> 1.1, >= 1.1.1)
|
kaminari (~> 1.1, >= 1.1.1)
|
||||||
listen (>= 3.0.5, < 3.2)
|
listen (>= 3.0.5, < 3.2)
|
||||||
mysql2 (>= 0.4.4, < 0.6.0)
|
mysql2 (>= 0.4.4, < 0.6.0)
|
||||||
oauth2
|
oauth2
|
||||||
pdfkit
|
pdfkit
|
||||||
puma (~> 3.11)
|
puma (~> 3.11)
|
||||||
rack-cors
|
rack-cors
|
||||||
rails (~> 5.2.0)
|
rails (~> 5.2.0)
|
||||||
rails-i18n (~> 5.1)
|
rails-i18n (~> 5.1)
|
||||||
rchardet (~> 1.8)
|
rchardet (~> 1.8)
|
||||||
redcarpet (~> 3.4)
|
redcarpet (~> 3.4)
|
||||||
redis-rails
|
redis-rails
|
||||||
roo-xls
|
roo-xls
|
||||||
rqrcode (~> 0.10.1)
|
rqrcode (~> 0.10.1)
|
||||||
rqrcode_png
|
rqrcode_png
|
||||||
rspec-rails (~> 3.8)
|
rspec-rails (~> 3.8)
|
||||||
ruby-ole
|
ruby-ole
|
||||||
rubyzip
|
rubyzip
|
||||||
sass-rails (~> 5.0)
|
sass-rails (~> 5.0)
|
||||||
searchkick
|
searchkick
|
||||||
selenium-webdriver
|
selenium-webdriver
|
||||||
sidekiq
|
sidekiq
|
||||||
simple_form
|
simple_form
|
||||||
simple_xlsx_reader
|
simple_xlsx_reader
|
||||||
sinatra
|
sinatra
|
||||||
spreadsheet
|
spreadsheet
|
||||||
spring
|
spring
|
||||||
spring-watcher-listen (~> 2.0.0)
|
spring-watcher-listen (~> 2.0.0)
|
||||||
turbolinks (~> 5)
|
turbolinks (~> 5)
|
||||||
tzinfo-data
|
tzinfo-data
|
||||||
uglifier (>= 1.3.0)
|
uglifier (>= 1.3.0)
|
||||||
web-console (>= 3.3.0)
|
web-console (>= 3.3.0)
|
||||||
wkhtmltopdf-binary
|
wkhtmltopdf-binary
|
||||||
|
|
||||||
RUBY VERSION
|
RUBY VERSION
|
||||||
ruby 2.3.7p456
|
ruby 2.3.7p456
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
1.17.3
|
1.17.3
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
// Place all the behaviors and hooks related to the matching controller here.
|
||||||
|
// All this logic will automatically be available in application.js.
|
@ -0,0 +1,3 @@
|
|||||||
|
// Place all the styles related to the initialization_data controller here.
|
||||||
|
// They will automatically be included in application.css.
|
||||||
|
// You can use Sass (SCSS) here: http://sass-lang.com/
|
@ -0,0 +1,114 @@
|
|||||||
|
class InitializationDataController < ApplicationController
|
||||||
|
|
||||||
|
def init_subjects
|
||||||
|
raise("实践课程id不能为空") if params[:paths].blank?
|
||||||
|
paths = params[:paths].split(",")
|
||||||
|
origin_database = EduSetting.where(name: origin_database)&.value
|
||||||
|
database = EduSetting.where(name: database)&.value
|
||||||
|
# 获取原始数据库导入数据
|
||||||
|
get_origin_data origin_database, paths
|
||||||
|
# 创建初始数据
|
||||||
|
create_init_data database
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private
|
||||||
|
def get_origin_data origin_database, paths
|
||||||
|
connect_to_origin_date(origin_database)
|
||||||
|
@subjects = get_subject_data(paths)
|
||||||
|
@stages = get_stages_data(@subjects)
|
||||||
|
@stage_shixuns = get_stage_shixuns_data(@stages)
|
||||||
|
@shixuns = get_shixun_data(@stage_shixuns)
|
||||||
|
@shixun_mirror_repositories = get_shixun_mirror_repositories_data(@shixuns)
|
||||||
|
@shixun_tag_repertoires = get_shixun_tag_repertoires_data(@shixuns)
|
||||||
|
@shixun_service_configs = get_shixun_service_configs_data(@shixuns)
|
||||||
|
@challenges = get_challenges_data(@shixuns)
|
||||||
|
@challenge_tags = get_challenge_tags_data(@challenges)
|
||||||
|
@test_sets = get_test_sets_data(@challenges)
|
||||||
|
@challenge_chooses = get_challenge_chooses_data(@challenges)
|
||||||
|
@challenge_questions = get_challenge_questions_data(@challenge_chooses)
|
||||||
|
end
|
||||||
|
|
||||||
|
def create_init_data database
|
||||||
|
connect_to_origin_date database
|
||||||
|
#copy_shixuns
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
# 链接库
|
||||||
|
def connect_to_origin_date database
|
||||||
|
ActiveRecord::Base.establish_connection(
|
||||||
|
adapter: "mysql2",
|
||||||
|
host: "localhost",
|
||||||
|
username: "root",
|
||||||
|
password: "123456",
|
||||||
|
database: "#{database}"
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
# 查询需要的路径
|
||||||
|
def get_subject_data paths
|
||||||
|
Subject.where(id: paths)
|
||||||
|
end
|
||||||
|
|
||||||
|
# 获取实践课程的章节
|
||||||
|
def get_stages_data subjects
|
||||||
|
Stage.where(subject_id: subjects)
|
||||||
|
end
|
||||||
|
|
||||||
|
# 获取时间课程的关联实训表
|
||||||
|
def get_stage_shixuns_data stages
|
||||||
|
StageShixun.where(stage_id: stages)
|
||||||
|
end
|
||||||
|
|
||||||
|
# 获取实训数据
|
||||||
|
def get_shixun_data stage_shixuns
|
||||||
|
Shixun.where(id: stage_shixuns.map(&:shixun_id))
|
||||||
|
end
|
||||||
|
|
||||||
|
# 获取关卡数据
|
||||||
|
def get_challenges_data shixuns
|
||||||
|
Challenge.where(shixun_id: shixuns)
|
||||||
|
end
|
||||||
|
|
||||||
|
# 获取关卡标签数据
|
||||||
|
def get_challenge_tags_data challenges
|
||||||
|
ChallengeTag.where(challenge_id: challenges)
|
||||||
|
end
|
||||||
|
|
||||||
|
# 获取实训技能标签数据
|
||||||
|
def get_shixun_mirror_repositories_data shixuns
|
||||||
|
ShixunMirrorRepository.where(shixun_id: shixuns)
|
||||||
|
end
|
||||||
|
|
||||||
|
# 获取实训标签
|
||||||
|
def get_shixun_tag_repertoires_data shixuns
|
||||||
|
ShixunTagRepertoire.where(shixun_id: shixuns)
|
||||||
|
end
|
||||||
|
|
||||||
|
# 获取实训镜像配置
|
||||||
|
def get_shixun_service_configs_data shixuns
|
||||||
|
ShixunServiceConfig.where(shixun_id: shixuns)
|
||||||
|
end
|
||||||
|
|
||||||
|
# 获取测试集数据
|
||||||
|
def get_test_sets_data challenges
|
||||||
|
TestSet.where(challenge_id: challenges)
|
||||||
|
end
|
||||||
|
|
||||||
|
# 获取选择题题目
|
||||||
|
def get_challenge_chooses_data challenges
|
||||||
|
ChallengeChoose.where(challenge_id: challenges)
|
||||||
|
end
|
||||||
|
|
||||||
|
# 复制选择题选项
|
||||||
|
def get_challenge_questions_data challenge_chooses
|
||||||
|
ChallengeQuestion.where(challenge_choose_id: challenge_chooses)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
end
|
@ -0,0 +1,2 @@
|
|||||||
|
module InitializationDataHelper
|
||||||
|
end
|
File diff suppressed because it is too large
Load Diff
@ -1,26 +0,0 @@
|
|||||||
class CreateGraduationTopics < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
create_table :graduation_topics do |t|
|
|
||||||
t.references :user
|
|
||||||
t.references :course
|
|
||||||
t.integer :tea_id
|
|
||||||
t.string :name
|
|
||||||
t.text :description
|
|
||||||
t.integer :status, :default => 0
|
|
||||||
t.integer :topic_type
|
|
||||||
t.integer :source
|
|
||||||
t.integer :property
|
|
||||||
t.integer :property_two
|
|
||||||
t.string :source_unit
|
|
||||||
t.integer :repeat
|
|
||||||
t.string :province
|
|
||||||
t.string :city
|
|
||||||
t.boolean :is_public, :default => 0
|
|
||||||
|
|
||||||
t.timestamps
|
|
||||||
end
|
|
||||||
add_index :graduation_topics, :user_id
|
|
||||||
add_index :graduation_topics, :course_id
|
|
||||||
add_index :graduation_topics, :tea_id
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,6 +0,0 @@
|
|||||||
class AddColumnToPoll < ActiveRecord::Migration[5.2]
|
|
||||||
# 问卷是否实名
|
|
||||||
def change
|
|
||||||
add_column :polls, :un_anonymous, :boolean, :default => 0
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class AddRepoNameToShixuns < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :shixuns, :repo_name, :string
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class AddRepoNameToMyshixuns < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :myshixuns, :repo_name, :string
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,13 +0,0 @@
|
|||||||
class CreateRelationships < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
create_table :relationships do |t|
|
|
||||||
t.integer :follower_id
|
|
||||||
t.integer :followed_id
|
|
||||||
|
|
||||||
t.timestamps
|
|
||||||
end
|
|
||||||
add_index :relationships, :followed_id
|
|
||||||
add_index :relationships, :follower_id
|
|
||||||
add_index :relationships, [:follower_id, :followed_id], unique: true
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,6 +0,0 @@
|
|||||||
class SyncGitlabAdmin < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
user = User.find_by_login("forge01")
|
|
||||||
user.update_column(:mail, 'admin@example.com')
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class AddCloudUrlToAttachments < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :attachments, :cloud_url, :string, default: ''
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class AddAvergeStarToShixuns < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :shixuns, :averge_star, :float, :default => 0
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,12 +0,0 @@
|
|||||||
class SyncAvergerStarToShixun < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
Shixun.find_each do |shixun|
|
|
||||||
averge_star = Game.find_by_sql("select ifnull(sum(g.star),0)/ifnull(count(*),1) as averge_star from (games g left join
|
|
||||||
(myshixuns m join shixuns s on s.id = m.shixun_id) on m.id = g.myshixun_id)
|
|
||||||
where star != 0 and s.id = #{shixun.id}").first.try(:averge_star)
|
|
||||||
averge_star = averge_star || 5
|
|
||||||
puts(averge_star)
|
|
||||||
shixun.update_column(:averge_star, averge_star.round(1))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,12 +0,0 @@
|
|||||||
class CreateShixunInfos < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
create_table :shixun_infos do |t|
|
|
||||||
t.longtext :propaedeutics
|
|
||||||
t.longtext :description
|
|
||||||
t.longtext :evaluate_script
|
|
||||||
t.integer :shixun_id
|
|
||||||
|
|
||||||
t.timestamps
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class AddIndexToUsers < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_index :users, :experience
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,6 +0,0 @@
|
|||||||
class ModifyStatusAndVisitsForSubjects < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
change_column :subjects, :status, :integer, :default => 0
|
|
||||||
change_column :subjects, :visits, :integer, :default => 1
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class AddOpeningTimeForShixuns < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :shixuns, :opening_time, :string
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class ModifyOpeningTimeForShixuns < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
change_column :shixuns, :opening_time, :datetime
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class AddAvergeStarDefaultForShixuns < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
change_column :shixuns, :averge_star, :float, :default => 5
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,16 +0,0 @@
|
|||||||
class SyncReponame < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
g = Gitlab.client
|
|
||||||
myshixuns = Myshixun.where("repo_name is null")
|
|
||||||
myshixuns.find_each do |myshixun|
|
|
||||||
begin
|
|
||||||
puts myshixun.id
|
|
||||||
repo_name = g.project(myshixun.gpid).path_with_namespace
|
|
||||||
puts repo_name
|
|
||||||
myshixun.update_column(:repo_name, repo_name)
|
|
||||||
rescue Exception => e
|
|
||||||
Rails.logger.error("e.message")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class AddShixunsCountToStage < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :stages, :shixuns_count, :integer, default: 0
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class AddShixunsCountToSubject < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :subjects, :shixuns_count, :integer, default: 0
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,8 +0,0 @@
|
|||||||
class SyncCacheCountForSubjects < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
Subject.find_each do |s|
|
|
||||||
Subject.reset_counters s.id, :shixuns
|
|
||||||
Subject.reset_counters s.id, :stages
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class AddUsersCountToShixun < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :shixuns, :users_count, :integer, default: 0
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,7 +0,0 @@
|
|||||||
class SyncUsersCountForShixun < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
Shixun.find_each do |s|
|
|
||||||
Shixun.reset_counters s.id, :users_count
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,6 +0,0 @@
|
|||||||
class DeleteNoneMyshixunGames < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
games = Game.where.not(myshixun_id: Myshixun.where(nil).pluck(:id))
|
|
||||||
games.destroy_all
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,13 +0,0 @@
|
|||||||
class CreateChallengeAnswers < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
create_table :challenge_answers do |t|
|
|
||||||
t.string :name
|
|
||||||
t.longtext :contents
|
|
||||||
t.integer :score
|
|
||||||
t.integer :level
|
|
||||||
t.references :challenge, index: true
|
|
||||||
t.timestamps
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,19 +0,0 @@
|
|||||||
class CreateCourseMembers < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
create_table :course_members do |t|
|
|
||||||
t.integer :course_id
|
|
||||||
t.integer :user_id
|
|
||||||
t.integer :course_group_id, default: 0
|
|
||||||
t.integer :graduation_group_id, default: 0
|
|
||||||
t.integer :role, default: 0
|
|
||||||
t.boolean :is_active, default: 1
|
|
||||||
|
|
||||||
t.timestamps
|
|
||||||
end
|
|
||||||
|
|
||||||
add_index :course_members, :course_id
|
|
||||||
add_index :course_members, :user_id
|
|
||||||
add_index :course_members, :course_group_id
|
|
||||||
add_index :course_members, :graduation_group_id
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class ModifyAnswerOpenForGames < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
change_column :games, :answer_open, :integer, :default => 0
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class AddCheckoutAnswerScoreForGames < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :games, :answer_deduction, :integer, :default => 0
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,9 +0,0 @@
|
|||||||
class AddCourseMembersCountToCourse < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :courses, :course_members_count, :integer, default: 0
|
|
||||||
|
|
||||||
Course.find_each do |c|
|
|
||||||
Course.reset_counters c.id, :course_members
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,6 +0,0 @@
|
|||||||
class AddScoreForTestSets < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :test_sets, :score, :integer
|
|
||||||
add_column :challenges, :test_set_score, :boolean, :default => false
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,10 +0,0 @@
|
|||||||
class AddAnswerForChallengeAnswer < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
challenges = Challenge.where("answer is not null")
|
|
||||||
challenges.find_each do |c|
|
|
||||||
puts "####################{c.id}"
|
|
||||||
ChallengeAnswer.create(name: "解题代码", contents: "#{c.answer}", level: 1, score: 100, challenge_id: c.id)
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class AddPodLifeToShixuns < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :shixuns, :pod_life, :integer, :default => 0
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,38 +0,0 @@
|
|||||||
class MigrateCourseMembers < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
# add_column :course_groups, :position, :integer, default: 0
|
|
||||||
|
|
||||||
Course.find_each do |course|
|
|
||||||
position = 1
|
|
||||||
course.course_groups.reorder("CONVERT(course_groups.name USING gbk) COLLATE gbk_chinese_ci ASC").each do |group|
|
|
||||||
group.update_attribute(:position, position)
|
|
||||||
position += 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
add_column :course_groups, :course_members_count, :integer, default: 0
|
|
||||||
|
|
||||||
CourseGroup.find_each do |g|
|
|
||||||
CourseGroup.reset_counters g.id, :course_members
|
|
||||||
end
|
|
||||||
|
|
||||||
ActiveRecord::Base.transaction do
|
|
||||||
begin
|
|
||||||
Member.where("course_id != -1").includes(:member_roles).find_each(batch_size: 500) do |member|
|
|
||||||
puts(member.id)
|
|
||||||
member.member_roles.each do |role|
|
|
||||||
course_member_role = role.role_id == 3 ? 1 : (role.role_id == 9 ? 2 : (role.role_id == 7 ? 3 : 4))
|
|
||||||
member_group_id = role.role_id == 10 ? member.course_group_id : 0
|
|
||||||
CourseMember.create!(course_id: member.course_id, user_id: member.user_id, course_group_id: member_group_id,
|
|
||||||
graduation_group_id: member.graduation_group_id, role: course_member_role, is_active: role.is_current)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
rescue Exception => e
|
|
||||||
uid_logger_error(e.message)
|
|
||||||
tip_exception("migrate_course_members 迁移失败!")
|
|
||||||
raise ActiveRecord::Rollback
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,21 +0,0 @@
|
|||||||
class AddCourseMemberId < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :student_graduation_topics, :course_member_id, :integer
|
|
||||||
add_index :student_graduation_topics, :course_member_id
|
|
||||||
|
|
||||||
StudentGraduationTopic.find_each do |student|
|
|
||||||
course_member = CourseMember.where(course_id: student.course_id, user_id: student.user_id,
|
|
||||||
role: 4).first
|
|
||||||
student.update_column("course_member_id", course_member.try(:id)) if course_member.present?
|
|
||||||
end
|
|
||||||
|
|
||||||
add_column :teacher_course_groups, :course_member_id, :integer
|
|
||||||
add_index :teacher_course_groups, :course_member_id
|
|
||||||
|
|
||||||
TeacherCourseGroup.find_each do |teacher|
|
|
||||||
course_member = CourseMember.where(course_id: teacher.course_id, user_id: teacher.user_id,
|
|
||||||
role: [1, 2, 3]).first
|
|
||||||
teacher.update_column("course_member_id", course_member.try(:id)) if course_member.present?
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,9 +0,0 @@
|
|||||||
class AddCourseGroupsCountToCourse < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :courses, :course_groups_count, :integer, default: 0
|
|
||||||
|
|
||||||
Course.find_each do |c|
|
|
||||||
Course.reset_counters c.id, :course_groups
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class AddPositionToCourseGroups < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,12 +0,0 @@
|
|||||||
class CreateCourseSecondCategories < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
create_table :course_second_categories do |t|
|
|
||||||
t.references :course
|
|
||||||
t.string :category_type
|
|
||||||
t.string :name
|
|
||||||
t.integer :position
|
|
||||||
|
|
||||||
t.timestamps
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,19 +0,0 @@
|
|||||||
class MigrateCourseSecondCategory < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :homework_commons, :course_second_category_id, :integer, default: 0
|
|
||||||
add_index :homework_commons, :course_second_category_id
|
|
||||||
add_column :course_second_categories, :course_module_id, :integer
|
|
||||||
add_index :course_second_categories, :course_module_id
|
|
||||||
|
|
||||||
Course.find_each do |course|
|
|
||||||
homework_position = 1
|
|
||||||
course_module = course.course_modules.where(module_type: "shixun_homework").first
|
|
||||||
course.course_homework_categories.reorder("CONVERT(name USING gbk) COLLATE gbk_chinese_ci ASC").find_each do |category|
|
|
||||||
new_category = CourseSecondCategory.create!(course_id: course.id, name: category.name, category_type: "shixun_homework",
|
|
||||||
position: homework_position, course_module_id: course_module.id)
|
|
||||||
course.homework_commons.where(course_homework_category_id: category.id).update_all(course_second_category_id: new_category.id)
|
|
||||||
homework_position += 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,6 +0,0 @@
|
|||||||
class AddCourseSecondCategoryToAttachment < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :attachments, :course_second_category_id, :integer, default: 0
|
|
||||||
add_index :attachments, :course_second_category_id
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,11 +0,0 @@
|
|||||||
class AddPraisesCountToMessages < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :messages, :praises_count, :integer, :default => 0
|
|
||||||
|
|
||||||
Message.find_each do |msg|
|
|
||||||
total_count = msg.praise_treads.liker.count
|
|
||||||
puts "====> set message's praises_count to #{total_count}"
|
|
||||||
msg.update_column(:praises_count, total_count)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class ChangePraiseOrTreadDefaultInPraiseTreads < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
change_column_default :praise_treads, :praise_or_tread, from: nil, to: 1
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,11 +0,0 @@
|
|||||||
class CreateMessageDetails < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
create_table :message_details do |t|
|
|
||||||
t.longtext :content
|
|
||||||
t.integer :message_id
|
|
||||||
|
|
||||||
t.timestamps
|
|
||||||
end
|
|
||||||
add_index :message_details, :message_id
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,10 +0,0 @@
|
|||||||
class MoveContentOfMessagesToMessageDetails < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
Message.find_each do |msg|
|
|
||||||
unless msg.message_detail.present?
|
|
||||||
message_detail = MessageDetail.create(message: msg, content: msg.content)
|
|
||||||
puts "-------> create MessageDetail success: id is #{message_detail.id}"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class RemoveContentFromMessages < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
remove_column :messages, :content, :longtext
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,8 +0,0 @@
|
|||||||
class ModifyGraduationTopics < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
rename_column :graduation_topics, :source, :topic_source
|
|
||||||
rename_column :graduation_topics, :property, :topic_property_first
|
|
||||||
rename_column :graduation_topics, :property_two, :topic_property_second
|
|
||||||
rename_column :graduation_topics, :repeat, :topic_repeat
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,8 +0,0 @@
|
|||||||
class AddIsPublicToGraduationTask < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :graduation_tasks, :is_public, :boolean, default: false
|
|
||||||
add_column :graduation_tasks, :late_time, :datetime
|
|
||||||
|
|
||||||
GraduationTask.where(status: 3).update_all(status: 4)
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class ChangeDigestToStringInAttachments < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
change_column :attachments, :digest, :string, :limit => 60
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class AddHiddenForJournalForMessages < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :journals_for_messages, :hidden, :boolean, :default => false
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,6 +0,0 @@
|
|||||||
class AddIsHiddenToMessages < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :messages, :is_hidden, :boolean, :default => false
|
|
||||||
add_index :messages, :is_hidden
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class CourseGroupCountCache < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class AddIndexToShixunInfos < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_index :shixun_infos, :shixun_id, unique: true
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,6 +0,0 @@
|
|||||||
class ChangeQuotesToIntegerInAttachments < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
change_column :attachments, :quotes, :integer, :default => 0
|
|
||||||
add_index :attachments, :quotes
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class AddIndexToAttachmentsIsPublic < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_index :attachments, :is_public
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class AddInvalidToGraduationWorkScore < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :graduation_work_scores, :is_invalid, :boolean, default: false
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,40 +0,0 @@
|
|||||||
# This migration comes from acts_as_taggable_on_engine (originally 1)
|
|
||||||
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
|
||||||
class ActsAsTaggableOnMigration < ActiveRecord::Migration[4.2]; end
|
|
||||||
else
|
|
||||||
class ActsAsTaggableOnMigration < ActiveRecord::Migration; end
|
|
||||||
end
|
|
||||||
ActsAsTaggableOnMigration.class_eval do
|
|
||||||
def self.up
|
|
||||||
unless ActiveRecord::Base.connection.table_exists? 'tags'
|
|
||||||
create_table :tags do |t|
|
|
||||||
t.string :name
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
unless ActiveRecord::Base.connection.table_exists? 'taggings'
|
|
||||||
create_table :taggings do |t|
|
|
||||||
t.references :tag
|
|
||||||
|
|
||||||
# You should make sure that the column created is
|
|
||||||
# long enough to store the required class names.
|
|
||||||
t.references :taggable, polymorphic: true
|
|
||||||
t.references :tagger, polymorphic: true
|
|
||||||
|
|
||||||
# Limit is created to prevent MySQL error on index
|
|
||||||
# length for MyISAM table type: http://bit.ly/vgW2Ql
|
|
||||||
t.string :context, limit: 128
|
|
||||||
|
|
||||||
t.datetime :created_at
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# add_index :taggings, :tag_id
|
|
||||||
# add_index :taggings, [:taggable_id, :taggable_type, :context]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.down
|
|
||||||
drop_table :taggings
|
|
||||||
drop_table :tags
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,26 +0,0 @@
|
|||||||
# This migration comes from acts_as_taggable_on_engine (originally 2)
|
|
||||||
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
|
||||||
class AddMissingUniqueIndices < ActiveRecord::Migration[4.2]; end
|
|
||||||
else
|
|
||||||
class AddMissingUniqueIndices < ActiveRecord::Migration; end
|
|
||||||
end
|
|
||||||
AddMissingUniqueIndices.class_eval do
|
|
||||||
def self.up
|
|
||||||
# add_index :tags, :name, unique: true
|
|
||||||
|
|
||||||
remove_index :taggings, :tag_id if index_exists?(:taggings, :tag_id)
|
|
||||||
remove_index :taggings, [:taggable_id, :taggable_type, :context]
|
|
||||||
add_index :taggings,
|
|
||||||
[:tag_id, :taggable_id, :taggable_type, :context, :tagger_id, :tagger_type],
|
|
||||||
unique: true, name: 'taggings_idx'
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.down
|
|
||||||
remove_index :tags, :name
|
|
||||||
|
|
||||||
remove_index :taggings, name: 'taggings_idx'
|
|
||||||
|
|
||||||
add_index :taggings, :tag_id unless index_exists?(:taggings, :tag_id)
|
|
||||||
add_index :taggings, [:taggable_id, :taggable_type, :context]
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,20 +0,0 @@
|
|||||||
# This migration comes from acts_as_taggable_on_engine (originally 3)
|
|
||||||
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
|
||||||
class AddTaggingsCounterCacheToTags < ActiveRecord::Migration[4.2]; end
|
|
||||||
else
|
|
||||||
class AddTaggingsCounterCacheToTags < ActiveRecord::Migration; end
|
|
||||||
end
|
|
||||||
AddTaggingsCounterCacheToTags.class_eval do
|
|
||||||
def self.up
|
|
||||||
add_column :tags, :taggings_count, :integer, default: 0
|
|
||||||
|
|
||||||
ActsAsTaggableOn::Tag.reset_column_information
|
|
||||||
ActsAsTaggableOn::Tag.find_each do |tag|
|
|
||||||
ActsAsTaggableOn::Tag.reset_counters(tag.id, :taggings)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.down
|
|
||||||
remove_column :tags, :taggings_count
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,15 +0,0 @@
|
|||||||
# This migration comes from acts_as_taggable_on_engine (originally 4)
|
|
||||||
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
|
||||||
class AddMissingTaggableIndex < ActiveRecord::Migration[4.2]; end
|
|
||||||
else
|
|
||||||
class AddMissingTaggableIndex < ActiveRecord::Migration; end
|
|
||||||
end
|
|
||||||
AddMissingTaggableIndex.class_eval do
|
|
||||||
def self.up
|
|
||||||
add_index :taggings, [:taggable_id, :taggable_type, :context]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.down
|
|
||||||
remove_index :taggings, [:taggable_id, :taggable_type, :context]
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,15 +0,0 @@
|
|||||||
# This migration comes from acts_as_taggable_on_engine (originally 5)
|
|
||||||
# This migration is added to circumvent issue #623 and have special characters
|
|
||||||
# work properly
|
|
||||||
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
|
||||||
class ChangeCollationForTagNames < ActiveRecord::Migration[4.2]; end
|
|
||||||
else
|
|
||||||
class ChangeCollationForTagNames < ActiveRecord::Migration; end
|
|
||||||
end
|
|
||||||
ChangeCollationForTagNames.class_eval do
|
|
||||||
def up
|
|
||||||
if ActsAsTaggableOn::Utils.using_mysql?
|
|
||||||
execute("ALTER TABLE tags MODIFY name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin;")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,23 +0,0 @@
|
|||||||
# This migration comes from acts_as_taggable_on_engine (originally 6)
|
|
||||||
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
|
||||||
class AddMissingIndexesOnTaggings < ActiveRecord::Migration[4.2]; end
|
|
||||||
else
|
|
||||||
class AddMissingIndexesOnTaggings < ActiveRecord::Migration; end
|
|
||||||
end
|
|
||||||
AddMissingIndexesOnTaggings.class_eval do
|
|
||||||
def change
|
|
||||||
add_index :taggings, :tag_id unless index_exists? :taggings, :tag_id
|
|
||||||
add_index :taggings, :taggable_id unless index_exists? :taggings, :taggable_id
|
|
||||||
add_index :taggings, :taggable_type unless index_exists? :taggings, :taggable_type
|
|
||||||
add_index :taggings, :tagger_id unless index_exists? :taggings, :tagger_id
|
|
||||||
add_index :taggings, :context unless index_exists? :taggings, :context
|
|
||||||
|
|
||||||
unless index_exists? :taggings, [:tagger_id, :tagger_type]
|
|
||||||
add_index :taggings, [:tagger_id, :tagger_type]
|
|
||||||
end
|
|
||||||
|
|
||||||
unless index_exists? :taggings, [:taggable_id, :taggable_type, :tagger_id, :context], name: 'taggings_idy'
|
|
||||||
add_index :taggings, [:taggable_id, :taggable_type, :tagger_id, :context], name: 'taggings_idy'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,19 +0,0 @@
|
|||||||
class CreateGtaskBanks < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
create_table :gtask_banks do |t|
|
|
||||||
t.references :user
|
|
||||||
t.string :name
|
|
||||||
t.text :description
|
|
||||||
t.integer :task_type
|
|
||||||
t.integer :min_num, default: 0
|
|
||||||
t.integer :max_num, default: 0
|
|
||||||
t.integer :base_on_project, default: false
|
|
||||||
t.boolean :is_public, default: false
|
|
||||||
t.integer :quotes, default: 0
|
|
||||||
t.references :graduation_task
|
|
||||||
t.references :course_list
|
|
||||||
|
|
||||||
t.timestamps
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,13 +0,0 @@
|
|||||||
class AddPraisesCountForJouranlsForMessages < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :journals_for_messages, :praises_count, :integer, :default => 0
|
|
||||||
|
|
||||||
messages = JournalsForMessage.includes(:praise_treads).all
|
|
||||||
messages.find_each do |m|
|
|
||||||
puts("####{m.id}")
|
|
||||||
praises_count = m.praise_treads.liker.count
|
|
||||||
m.update_column(:praises_count, praises_count)
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,23 +0,0 @@
|
|||||||
class CreateGtopicBanks < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
create_table :gtopic_banks do |t|
|
|
||||||
t.references :user
|
|
||||||
t.string :name
|
|
||||||
t.text :description
|
|
||||||
t.integer :quotes
|
|
||||||
t.boolean :is_public
|
|
||||||
t.integer :topic_type
|
|
||||||
t.integer :topic_source
|
|
||||||
t.integer :topic_property_first
|
|
||||||
t.integer :topic_property_second
|
|
||||||
t.string :source_unit
|
|
||||||
t.integer :topic_repeat
|
|
||||||
t.string :province
|
|
||||||
t.string :city
|
|
||||||
t.references :graduation_topic
|
|
||||||
t.references :course_list
|
|
||||||
|
|
||||||
t.timestamps
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,6 +0,0 @@
|
|||||||
class AddIsOrderedToExerciseStandardAnswers < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
#试题的多空标准答案是否为一一对应,默认为一一对应,即true
|
|
||||||
add_column :exercise_standard_answers,:is_ordered,:boolean,:default => true
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,12 +0,0 @@
|
|||||||
class ChangeColumnInHomeworks < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
change_column_default :homework_commons, :late_penalty, from: nil, to: 5
|
|
||||||
change_column_default :homework_commons, :anonymous_comment, from: 0, to: 1
|
|
||||||
change_column_default :homework_commons, :work_efficiency, from: 1, to: 0
|
|
||||||
change_column_default :homework_commons, :eff_score, from: 20, to: 0
|
|
||||||
change_column_default :homework_detail_manuals, :ta_proportion, from: nil, to: 0
|
|
||||||
change_column_default :homework_detail_manuals, :comment_status, from: nil, to: 0
|
|
||||||
change_column_default :homework_detail_manuals, :evaluation_num, from: nil, to: 0
|
|
||||||
change_column_default :homework_detail_manuals, :absence_penalty, from: 1, to: 0
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,6 +0,0 @@
|
|||||||
class ChangeIsOrderedFromAnswerToQuestion < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
remove_column :exercise_standard_answers,:is_ordered
|
|
||||||
add_column :exercise_questions,:is_ordered,:boolean,:default => true
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class MigrateHomeworkAttachments < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
Attachment.where(container_type: "HomeworkCommon").update_all(attachtype: 1)
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class AddCloudUrlToAttachmentHistories < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :attachment_histories, :cloud_url, :string, default: ''
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,13 +0,0 @@
|
|||||||
class ChangeHomeworkCommonColumns < ActiveRecord::Migration[5.2]
|
|
||||||
def up
|
|
||||||
change_column :homework_commons, :score_open, :boolean, default: 1
|
|
||||||
change_column :homework_commons, :anonymous_comment, :boolean, default: 1
|
|
||||||
change_column :homework_commons, :anonymous_appeal, :boolean, default: 0
|
|
||||||
end
|
|
||||||
|
|
||||||
def down
|
|
||||||
change_column :homework_commons, :score_open, :int, default: 1
|
|
||||||
change_column :homework_commons, :anonymous_comment, :int, default: 1
|
|
||||||
change_column :homework_commons, :anonymous_appeal, :int, default: 0
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,21 +0,0 @@
|
|||||||
class MigrateHomeworkLateTime < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
homeworks = HomeworkCommon.where.not(end_time: nil).where(homework_type: [1, 3 ,4], allow_late: 1, late_time: nil)
|
|
||||||
homeworks.each do |homework|
|
|
||||||
if homework.course.try(:end_date).present?
|
|
||||||
homework.update_column("late_time", homework.course.end_date)
|
|
||||||
elsif homework.end_time.present?
|
|
||||||
homework.update_column("late_time", Time.at(homework.end_time.to_i + 30*24*3600))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
tasks = GraduationTask.where.not(end_time: nil).where(allow_late: 1, late_time: nil)
|
|
||||||
tasks.each do |task|
|
|
||||||
if task.course.try(:end_date).present?
|
|
||||||
task.update_column("late_time", task.course.end_date)
|
|
||||||
elsif task.end_time.present?
|
|
||||||
task.update_column("late_time", Time.at(task.end_time.to_i + 30*24*3600))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,18 +0,0 @@
|
|||||||
class AddJournalsForMessagesCountForHmAndGtAndGw < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
#add_column :homework_commons, :journals_for_messages_count, :integer, :default => 0
|
|
||||||
#add_column :graduation_tasks, :journals_for_messages_count, :integer, :default => 0
|
|
||||||
#add_column :graduation_topics, :journals_for_messages_count, :integer, :default => 0
|
|
||||||
|
|
||||||
type = ["GraduationTopic", "GraduationTask", "HomeworkCommon"]
|
|
||||||
messages = JournalsForMessage.where(jour_type: type).where("m_parent_id is not null")
|
|
||||||
# 迁移所有2级以上的回复
|
|
||||||
messages.each do |message|
|
|
||||||
while message.parent.try(:m_parent_id).present? do
|
|
||||||
puts "parent: #{message.parent.try(:m_parent_id)}"
|
|
||||||
message.update_attribute(:m_parent_id, message.parent.m_parent_id)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,7 +0,0 @@
|
|||||||
class MigrateHomeworkAnonymousComment < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
change_column_default :homework_commons, :anonymous_comment, from: 1, to: 0
|
|
||||||
|
|
||||||
HomeworkCommon.update_all("anonymous_comment = !anonymous_comment")
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,25 +0,0 @@
|
|||||||
class AddIsInvalidToStudentWorksScores < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
# add_column :student_works_scores, :is_invalid, :boolean, default: false
|
|
||||||
|
|
||||||
StudentWorksScore.where("score is not null").order("id desc").find_each do |score|
|
|
||||||
unless score.is_invalid
|
|
||||||
if score.student_work.present?
|
|
||||||
puts score.id
|
|
||||||
work = score.student_work
|
|
||||||
|
|
||||||
# 如果分数是调整分 则之前的所有分都无效
|
|
||||||
if score.is_ultimate
|
|
||||||
work.student_works_scores.where("score is not null and id < #{score.id}").update_all(is_invalid: 1)
|
|
||||||
|
|
||||||
# 如果是同一个用户角色的重复评分,则之前的评分都无效
|
|
||||||
elsif work.student_works_scores.where("user_id = #{score.user_id} and reviewer_role = #{score.reviewer_role}
|
|
||||||
and score is not null and id < #{score.id}").count > 0
|
|
||||||
work.student_works_scores.where("user_id = #{score.user_id} and reviewer_role = #{score.reviewer_role}
|
|
||||||
and score is not null and id < #{score.id}").update_all(is_invalid: 1)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,29 +0,0 @@
|
|||||||
class ChangeExerciseScoreToFloat < ActiveRecord::Migration[5.2]
|
|
||||||
def up
|
|
||||||
change_column :exercise_users,:score,:decimal,precision: 10, scale: 1
|
|
||||||
change_column :exercise_users, :objective_score, :decimal,precision: 10, scale: 1,default: 0.0
|
|
||||||
# change_column :exercise_users, :subjective_score, :decimal,precision: 10, scale: 1,default: 0.0
|
|
||||||
change_column :exercise_users, :subjective_score, :decimal,precision: 10, scale: 1,default: -1.0
|
|
||||||
# change_column :exercise_answers,:score,:decimal,precision: 10, scale: 1,default: 0.0
|
|
||||||
change_column :exercise_answers,:score,:decimal,precision: 10, scale: 1,default: -1.0 #6.10修改,方便判断主观题是否批阅
|
|
||||||
change_column :exercise_bank_questions,:question_score,:decimal,precision: 10, scale: 1
|
|
||||||
change_column :exercise_bank_shixun_challenges,:question_score,:decimal,precision: 10, scale: 1
|
|
||||||
change_column :exercise_questions,:question_score,:decimal,precision: 10, scale: 1
|
|
||||||
change_column :exercise_shixun_answers,:score,:decimal,precision: 10, scale: 1
|
|
||||||
change_column :exercise_shixun_challenges,:question_score,:decimal,precision: 10, scale: 1
|
|
||||||
change_column :exercise_answer_comments, :score,:decimal,precision: 10, scale: 1
|
|
||||||
end
|
|
||||||
|
|
||||||
def down
|
|
||||||
change_column :exercise_users,:score,:integer
|
|
||||||
change_column :exercise_users, :objective_score, :integer,default: -1
|
|
||||||
change_column :exercise_users, :subjective_score, :integer,default: -1
|
|
||||||
change_column :exercise_answers,:score,:integer,default: -1
|
|
||||||
change_column :exercise_bank_questions,:question_score,:integer
|
|
||||||
change_column :exercise_shixun_answers,:score,:integer
|
|
||||||
change_column :exercise_bank_shixun_challenges,:question_score,:integer
|
|
||||||
change_column :exercise_questions,:question_score,:integer
|
|
||||||
change_column :exercise_shixun_challenges,:question_score,:integer
|
|
||||||
change_column :exercise_answer_comments, :score,:integer
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class ChangeDigestToStringInAttachmentHistories < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
change_column :attachment_histories, :digest, :string, :limit => 60
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,7 +0,0 @@
|
|||||||
class AddDefaultForExercises < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
change_column :exercises, :exercise_status, :integer, :default => 1
|
|
||||||
change_column :exercises, :show_result, :integer, :default => 1
|
|
||||||
change_column :exercises, :time, :integer, :default => -1
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class AddQuotesForGraduationTopics < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :graduation_topics, :quotes, :integer, :default => 0
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class AddDefaultForPolls < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
change_column :polls, :polls_status, :integer, :default => 1
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,8 +0,0 @@
|
|||||||
class SyncUsersIndex < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
remove_index :users, name: :index_users_on_phone_and_mail
|
|
||||||
remove_index :users, name: :index_users_on_id_and_type
|
|
||||||
remove_index :users, name: :index_users_on_auth_source_id
|
|
||||||
remove_index :users, name: :index_users_on_type
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class RemoveIndexFromUsers < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
remove_index :users, name: :index_users_on_experience
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,9 +0,0 @@
|
|||||||
class InitUseIndex < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
remove_index :users, name: :index_users_on_login if index_exists?(:users, :login, name: :index_users_on_login)
|
|
||||||
remove_index :users, name: :index_users_on_mail if index_exists?(:users, :mail, name: :index_users_on_mail)
|
|
||||||
# add_index :users, :login, unique: true
|
|
||||||
# add_index :users, :mail, unique: true
|
|
||||||
# add_index :users, :phone, unique: true
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,6 +0,0 @@
|
|||||||
class AddAuthenticationAndProfessionalCertificationToCourses < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :courses, :authentication, :boolean, default: false
|
|
||||||
add_column :courses, :professional_certification, :boolean, default: false
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,6 +0,0 @@
|
|||||||
class MigrateNewStudentWorkStatus < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
homeworks = HomeworkCommon.where(allow_late: 0)
|
|
||||||
StudentWork.where(homework_common_id: homeworks, work_status: 2).update_all(work_status: 1)
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class AddIsPublicToMessages < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :messages, :is_public, :boolean, :default => false
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,10 +0,0 @@
|
|||||||
class AddColumnToZipPacks < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :zip_packs, :container_id, :integer, default: 0
|
|
||||||
add_column :zip_packs, :container_type, :string
|
|
||||||
|
|
||||||
add_index :zip_packs, [:container_id, :container_type]
|
|
||||||
|
|
||||||
ZipPack.all.update_all("container_type='HomeworkCommon', container_id = homework_id")
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,11 +0,0 @@
|
|||||||
class ChangeQuestionRandomExercises < ActiveRecord::Migration[5.2]
|
|
||||||
def up
|
|
||||||
change_column :exercises,:question_random,:boolean,default: false
|
|
||||||
change_column :exercises,:choice_random,:boolean,default: false
|
|
||||||
|
|
||||||
end
|
|
||||||
def down
|
|
||||||
change_column :exercises,:question_random,:integer,default: 0
|
|
||||||
change_column :exercises,:choice_random,:integer,default: 0
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,10 +0,0 @@
|
|||||||
class ChangePollShowResultBoolean < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
def up
|
|
||||||
change_column :polls,:show_result,:boolean,default: true
|
|
||||||
end
|
|
||||||
def down
|
|
||||||
change_column :polls,:show_result,:integer,default: 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
class AddTestSetAverageForChallenges < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :challenges, :test_set_average, :boolean, :default => true
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,10 +0,0 @@
|
|||||||
class CreateEduSettings < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
create_table :edu_settings do |t|
|
|
||||||
t.string :name
|
|
||||||
t.string :value
|
|
||||||
|
|
||||||
t.timestamps
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,14 +0,0 @@
|
|||||||
class AddDescriptionToEduSettings < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_column :edu_settings, :description, :string
|
|
||||||
add_index :edu_settings, :name, unique: :true
|
|
||||||
|
|
||||||
['tomcat_webssh', 'webssh_username', 'webssh_password', 'git_address_ip', 'git_address_domain', 'git_username',
|
|
||||||
'git_password', 'public_key', 'private_key', 'public_bucket', 'public_bucket_host', 'public_cdn_host', 'cloud_bridge',
|
|
||||||
'cloud_tomcat_php', 'host_name', 'old_edu_host'].each do |name|
|
|
||||||
if EduSetting.find_by_name(name).nil?
|
|
||||||
EduSetting.create(name: name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,6 +0,0 @@
|
|||||||
class AddIndexToVerificatiojnCodes < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
add_index :verification_codes, [:phone], name: 'by_phone' if !index_exists?(:verification_codes, :phone)
|
|
||||||
add_index :verification_codes, [:email], name: 'by_email' if !index_exists?(:verification_codes, :email)
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,70 +0,0 @@
|
|||||||
class AlterEducoderIndexs < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
|
|
||||||
add_index :onclick_times, :user_id if !index_exists?(:onclick_times, :user_id)
|
|
||||||
remove_index :courses, :syllabus_id
|
|
||||||
add_index :courses, :tea_id
|
|
||||||
add_index :course_modules, [:course_id, :module_type]
|
|
||||||
remove_index :homework_commons, :course_homework_category_id
|
|
||||||
add_index :exercises, :course_id
|
|
||||||
remove_index :teacher_course_groups, :member_id
|
|
||||||
remove_index :student_works, :created_at
|
|
||||||
remove_index :student_works, :user_id
|
|
||||||
remove_index :student_works, :myshixun_id
|
|
||||||
remove_index :homework_challenge_settings, :shixun_id
|
|
||||||
remove_index :exercise_users, :exercise_id
|
|
||||||
add_index :exercise_users, [:exercise_id, :user_id]
|
|
||||||
add_index :homework_banks, :user_id
|
|
||||||
remove_index :exercise_answers, :exercise_choice_id
|
|
||||||
remove_index :exercise_answers, :exercise_question_id
|
|
||||||
add_index :exercise_answers, [:exercise_question_id, :user_id]
|
|
||||||
remove_index :exercise_shixun_challenges, :shixun_id
|
|
||||||
remove_index :exercise_shixun_answers, :exercise_shixun_challenge_id
|
|
||||||
remove_index :exercise_shixun_answers, :exercise_question_id
|
|
||||||
add_index :exercise_shixun_answers, [:exercise_question_id, :user_id], name: "exercise_question_id_user_id"
|
|
||||||
remove_index :student_works_evaluation_distributions, :student_work_id
|
|
||||||
add_index :student_works_evaluation_distributions, :user_id
|
|
||||||
remove_index :challenge_work_scores, :user_id
|
|
||||||
add_index :poll_questions, :poll_id
|
|
||||||
add_index :poll_users, [:poll_id, :user_id]
|
|
||||||
add_index :poll_answers, :poll_question_id
|
|
||||||
add_index :poll_votes, [:poll_question_id, :user_id], name: "poll_question_id_user_id"
|
|
||||||
remove_index :graduation_tasks, :user_id
|
|
||||||
remove_index :graduation_work_comment_assignations, :graduation_group_id
|
|
||||||
remove_index :graduation_works, :course_id
|
|
||||||
remove_index :graduation_works, :project_id
|
|
||||||
remove_index :graduation_works, :graduation_task_id
|
|
||||||
remove_index :graduation_works, :user_id
|
|
||||||
add_index :graduation_works, [:graduation_task_id, :user_id], name: "graduation_task_id_user_id"
|
|
||||||
|
|
||||||
remove_index :graduation_work_scores, :graduation_task_id
|
|
||||||
remove_index :graduation_topics, :user_id
|
|
||||||
remove_index :graduation_topics, :tea_id
|
|
||||||
remove_index :student_graduation_topics, :member_id
|
|
||||||
remove_index :student_graduation_topics, :course_member_id
|
|
||||||
add_index :boards, :course_id
|
|
||||||
remove_index :messages, :author_id
|
|
||||||
remove_index :messages, :is_hidden
|
|
||||||
remove_index :messages, :root_id
|
|
||||||
remove_index :messages, :created_on
|
|
||||||
remove_index :attachments, :quotes
|
|
||||||
remove_index :attachments, :is_public
|
|
||||||
remove_index :attachments, :course_second_category_id
|
|
||||||
remove_index :course_members, :graduation_group_id
|
|
||||||
add_index :student_works_scores_appeals, :student_works_score_id
|
|
||||||
add_index :challenges, :shixun_id
|
|
||||||
add_index :challenge_chooses, :challenge_id
|
|
||||||
add_index :challenge_questions, :challenge_choose_id
|
|
||||||
add_index :challenge_tags, :challenge_id
|
|
||||||
remove_index :games, :user_id
|
|
||||||
add_index :shixun_members, :shixun_id
|
|
||||||
add_index :shixun_tag_repertoires, [:shixun_id, :tag_repertoire_id], name: "shixun_id_tag_repertoire_id"
|
|
||||||
add_index :shixun_schools, :shixun_id
|
|
||||||
add_index :shixun_mirror_repositories, :shixun_id
|
|
||||||
add_index :shixun_modifies, [:shixun_id, :myshixun_id], name: "shixun_id_myshixun_id"
|
|
||||||
remove_index :myshixuns, :user_id
|
|
||||||
remove_index :outputs, :created_at
|
|
||||||
remove_index :outputs, :test_set_position
|
|
||||||
remove_index :stages, :user_id
|
|
||||||
end
|
|
||||||
end
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue