Description:
tag
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r681:bc0fcfe3abaa - - 23 files changed: 283 inserted, 3 deleted

@@ -0,0 +1,3
1 + # Place all the behaviors and hooks related to the matching controller here.
2 + # All this logic will automatically be available in application.js.
3 + # You can use CoffeeScript in this file: http://coffeescript.org/
@@ -0,0 +1,3
1 + // Place all the styles related to the tags controller here.
2 + // They will automatically be included in application.css.
3 + // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -0,0 +1,58
1 + class TagsController < ApplicationController
2 + before_action :set_tag, only: [:show, :edit, :update, :destroy]
3 +
4 + # GET /tags
5 + def index
6 + @tags = Tag.all
7 + end
8 +
9 + # GET /tags/1
10 + def show
11 + end
12 +
13 + # GET /tags/new
14 + def new
15 + @tag = Tag.new
16 + end
17 +
18 + # GET /tags/1/edit
19 + def edit
20 + end
21 +
22 + # POST /tags
23 + def create
24 + @tag = Tag.new(tag_params)
25 +
26 + if @tag.save
27 + redirect_to @tag, notice: 'Tag was successfully created.'
28 + else
29 + render :new
30 + end
31 + end
32 +
33 + # PATCH/PUT /tags/1
34 + def update
35 + if @tag.update(tag_params)
36 + redirect_to @tag, notice: 'Tag was successfully updated.'
37 + else
38 + render :edit
39 + end
40 + end
41 +
42 + # DELETE /tags/1
43 + def destroy
44 + @tag.destroy
45 + redirect_to tags_url, notice: 'Tag was successfully destroyed.'
46 + end
47 +
48 + private
49 + # Use callbacks to share common setup or constraints between actions.
50 + def set_tag
51 + @tag = Tag.find(params[:id])
52 + end
53 +
54 + # Only allow a trusted parameter "white list" through.
55 + def tag_params
56 + params.require(:tag).permit(:name, :description, :public)
57 + end
58 + end
@@ -0,0 +1,2
1 + module TagsHelper
2 + end
@@ -0,0 +1,8
1 + class ProblemTag < ActiveRecord::Base
2 + self.table_name = 'problems_tags'
3 +
4 + belongs_to :problem
5 + belongs_to :tag
6 +
7 + validates_uniqueness_of :problem_id, scope: :tag_id, message: ->(object, data) { "'#{Problem.find(data[:value]).full_name}' is already has this tag" }
8 + end
@@ -0,0 +1,4
1 + class Tag < ActiveRecord::Base
2 + has_many :problems_tags, class_name: ProblemTag
3 + has_many :problems, through: :problems_tags
4 + end
@@ -0,0 +1,22
1 + = form_for @tag do |f|
2 + - if @tag.errors.any?
3 + #error_explanation
4 + %h2= "#{pluralize(@tag.errors.count, "error")} prohibited this tag from being saved:"
5 + %ul
6 + - @tag.errors.full_messages.each do |msg|
7 + %li= msg
8 +
9 + .row
10 + .col-md-6
11 + .form-group.field
12 + = f.label :name
13 + = f.text_field :name, class: 'form-control'
14 + .form-group.field
15 + = f.label :description
16 + = f.text_area :description, class: 'form-control'
17 + .form-group.field
18 + = f.label :public
19 + = f.text_field :public, class: 'form-control'
20 + .actions
21 + = f.submit 'Save', class: 'btn btn-primary'
22 + .col-md-6
@@ -0,0 +1,7
1 + %h1 Editing tag
2 +
3 + = render 'form'
4 +
5 + = link_to 'Show', @tag
6 + \|
7 + = link_to 'Back', tags_path
@@ -0,0 +1,26
1 + %h1 Tags
2 +
3 + = link_to 'New Tag', new_tag_path, class: 'btn btn-success'
4 +
5 + %table.table.table-hover
6 + %thead
7 + %tr
8 + %th Name
9 + %th Description
10 + %th Public
11 + %th
12 + %th
13 + %th
14 +
15 + %tbody
16 + - @tags.each do |tag|
17 + %tr
18 + %td= tag.name
19 + %td= tag.description
20 + %td= tag.public
21 + %td= link_to 'Show', tag
22 + %td= link_to 'Edit', edit_tag_path(tag)
23 + %td= link_to 'Destroy', tag, :method => :delete, :data => { :confirm => 'Are you sure?' }
24 +
25 + %br
26 +
@@ -0,0 +1,5
1 + %h1 New tag
2 +
3 + = render 'form'
4 +
5 + = link_to 'Back', tags_path
@@ -0,0 +1,15
1 + %p#notice= notice
2 +
3 + %p
4 + %b Name:
5 + = @tag.name
6 + %p
7 + %b Description:
8 + = @tag.description
9 + %p
10 + %b Public:
11 + = @tag.public
12 +
13 + = link_to 'Edit', edit_tag_path(@tag)
14 + \|
15 + = link_to 'Back', tags_path
@@ -0,0 +1,11
1 + class CreateTags < ActiveRecord::Migration
2 + def change
3 + create_table :tags do |t|
4 + t.string :name, null: false
5 + t.text :description
6 + t.boolean :public
7 +
8 + t.timestamps null: false
9 + end
10 + end
11 + end
@@ -0,0 +1,10
1 + class CreateProblemTags < ActiveRecord::Migration
2 + def change
3 + create_table :problems_tags do |t|
4 + t.references :problem, index: true, foreign_key: true
5 + t.references :tag, index: true, foreign_key: true
6 +
7 + t.index [:problem_id,:tag_id], unique: true
8 + end
9 + end
10 + end
@@ -0,0 +1,49
1 + require 'test_helper'
2 +
3 + class TagsControllerTest < ActionController::TestCase
4 + setup do
5 + @tag = tags(:one)
6 + end
7 +
8 + test "should get index" do
9 + get :index
10 + assert_response :success
11 + assert_not_nil assigns(:tags)
12 + end
13 +
14 + test "should get new" do
15 + get :new
16 + assert_response :success
17 + end
18 +
19 + test "should create tag" do
20 + assert_difference('Tag.count') do
21 + post :create, tag: { description: @tag.description, name: @tag.name, public: @tag.public }
22 + end
23 +
24 + assert_redirected_to tag_path(assigns(:tag))
25 + end
26 +
27 + test "should show tag" do
28 + get :show, id: @tag
29 + assert_response :success
30 + end
31 +
32 + test "should get edit" do
33 + get :edit, id: @tag
34 + assert_response :success
35 + end
36 +
37 + test "should update tag" do
38 + patch :update, id: @tag, tag: { description: @tag.description, name: @tag.name, public: @tag.public }
39 + assert_redirected_to tag_path(assigns(:tag))
40 + end
41 +
42 + test "should destroy tag" do
43 + assert_difference('Tag.count', -1) do
44 + delete :destroy, id: @tag
45 + end
46 +
47 + assert_redirected_to tags_path
48 + end
49 + end
@@ -0,0 +1,9
1 + # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 +
3 + one:
4 + problem_id:
5 + tag_id:
6 +
7 + two:
8 + problem_id:
9 + tag_id:
@@ -0,0 +1,11
1 + # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 +
3 + one:
4 + name: MyString
5 + description: MyString
6 + public:
7 +
8 + two:
9 + name: MyString
10 + description: MyString
11 + public:
@@ -0,0 +1,7
1 + require 'test_helper'
2 +
3 + class ProblemTagTest < ActiveSupport::TestCase
4 + # test "the truth" do
5 + # assert true
6 + # end
7 + end
@@ -0,0 +1,7
1 + require 'test_helper'
2 +
3 + class TagTest < ActiveSupport::TestCase
4 + # test "the truth" do
5 + # assert true
6 + # end
7 + end
@@ -1,7 +1,7
1 class GroupUser < ActiveRecord::Base
1 class GroupUser < ActiveRecord::Base
2 self.table_name = 'groups_users'
2 self.table_name = 'groups_users'
3 -
3 +
4 belongs_to :user
4 belongs_to :user
5 belongs_to :group
5 belongs_to :group
6 validates_uniqueness_of :user_id, scope: :group_id, message: ->(object, data) { "'#{User.find(data[:value]).full_name}' is already in the group" }
6 validates_uniqueness_of :user_id, scope: :group_id, message: ->(object, data) { "'#{User.find(data[:value]).full_name}' is already in the group" }
7 end
7 end
@@ -1,33 +1,36
1 class Problem < ActiveRecord::Base
1 class Problem < ActiveRecord::Base
2
2
3 belongs_to :description
3 belongs_to :description
4 has_and_belongs_to_many :contests, :uniq => true
4 has_and_belongs_to_many :contests, :uniq => true
5
5
6 #has_and_belongs_to_many :groups
6 #has_and_belongs_to_many :groups
7 has_many :groups_problems, class_name: GroupProblem
7 has_many :groups_problems, class_name: GroupProblem
8 has_many :groups, :through => :groups_problems
8 has_many :groups, :through => :groups_problems
9
9
10 + has_many :problems_tags, class_name: ProblemTag
11 + has_many :tags, through: :problems_tags
12 +
10 has_many :test_pairs, :dependent => :delete_all
13 has_many :test_pairs, :dependent => :delete_all
11 has_many :testcases, :dependent => :destroy
14 has_many :testcases, :dependent => :destroy
12
15
13 validates_presence_of :name
16 validates_presence_of :name
14 validates_format_of :name, :with => /\A\w+\z/
17 validates_format_of :name, :with => /\A\w+\z/
15 validates_presence_of :full_name
18 validates_presence_of :full_name
16
19
17 scope :available, -> { where(available: true) }
20 scope :available, -> { where(available: true) }
18
21
19 DEFAULT_TIME_LIMIT = 1
22 DEFAULT_TIME_LIMIT = 1
20 DEFAULT_MEMORY_LIMIT = 32
23 DEFAULT_MEMORY_LIMIT = 32
21
24
22 def self.available_problems
25 def self.available_problems
23 available.order(date_added: :desc).order(:name)
26 available.order(date_added: :desc).order(:name)
24 #Problem.available.all(:order => "date_added DESC, name ASC")
27 #Problem.available.all(:order => "date_added DESC, name ASC")
25 end
28 end
26
29
27 def self.create_from_import_form_params(params, old_problem=nil)
30 def self.create_from_import_form_params(params, old_problem=nil)
28 org_problem = old_problem || Problem.new
31 org_problem = old_problem || Problem.new
29 import_params, problem = Problem.extract_params_and_check(params,
32 import_params, problem = Problem.extract_params_and_check(params,
30 org_problem)
33 org_problem)
31
34
32 if !problem.errors.empty?
35 if !problem.errors.empty?
33 return problem, 'Error importing'
36 return problem, 'Error importing'
@@ -1,23 +1,23
1 # Be sure to restart your server when you modify this file.
1 # Be sure to restart your server when you modify this file.
2
2
3 # Version of your assets, change this if you want to expire all your assets.
3 # Version of your assets, change this if you want to expire all your assets.
4 Rails.application.config.assets.version = '1.0'
4 Rails.application.config.assets.version = '1.0'
5
5
6 # Add additional assets to the asset load path.
6 # Add additional assets to the asset load path.
7 # Rails.application.config.assets.paths << Emoji.images_path
7 # Rails.application.config.assets.paths << Emoji.images_path
8 # Add Yarn node_modules folder to the asset load path.
8 # Add Yarn node_modules folder to the asset load path.
9 Rails.application.config.assets.paths << Rails.root.join('node_modules')
9 Rails.application.config.assets.paths << Rails.root.join('node_modules')
10 Rails.application.config.assets.paths << Rails.root.join('vendor/assets/fonts')
10 Rails.application.config.assets.paths << Rails.root.join('vendor/assets/fonts')
11
11
12 # Precompile additional assets.
12 # Precompile additional assets.
13 # application.js, application.css, and all non-JS/CSS in the app/assets
13 # application.js, application.css, and all non-JS/CSS in the app/assets
14 # folder are already added.
14 # folder are already added.
15 # Rails.application.config.assets.precompile += %w( admin.js admin.css )
15 # Rails.application.config.assets.precompile += %w( admin.js admin.css )
16
16
17 Rails.application.config.assets.precompile += ['announcement_refresh.js','effects.js','site_update.js']
17 Rails.application.config.assets.precompile += ['announcement_refresh.js','effects.js','site_update.js']
18 Rails.application.config.assets.precompile += ['local_jquery.js','tablesorter-theme.cafe.css']
18 Rails.application.config.assets.precompile += ['local_jquery.js','tablesorter-theme.cafe.css']
19 %w( announcements submissions configurations contests contest_management graders heartbeat
19 %w( announcements submissions configurations contests contest_management graders heartbeat
20 login main messages problems report site sites sources tasks groups
20 login main messages problems report site sites sources tasks groups
21 - test user_admin users ).each do |controller|
21 + test user_admin users tags).each do |controller|
22 Rails.application.config.assets.precompile += ["#{controller}.js", "#{controller}.css"]
22 Rails.application.config.assets.precompile += ["#{controller}.js", "#{controller}.css"]
23 end
23 end
@@ -1,25 +1,26
1 CafeGrader::Application.routes.draw do
1 CafeGrader::Application.routes.draw do
2 + resources :tags
2 get "sources/direct_edit"
3 get "sources/direct_edit"
3
4
4 root :to => 'main#login'
5 root :to => 'main#login'
5
6
6 #logins
7 #logins
7 get 'login/login', to: 'login#login'
8 get 'login/login', to: 'login#login'
8
9
9 resources :contests
10 resources :contests
10
11
11 resources :sites
12 resources :sites
12
13
13 resources :announcements do
14 resources :announcements do
14 member do
15 member do
15 get 'toggle','toggle_front'
16 get 'toggle','toggle_front'
16 end
17 end
17 end
18 end
18
19
19 resources :problems do
20 resources :problems do
20 member do
21 member do
21 get 'toggle'
22 get 'toggle'
22 get 'toggle_test'
23 get 'toggle_test'
23 get 'toggle_view_testcase'
24 get 'toggle_view_testcase'
24 get 'stat'
25 get 'stat'
25 end
26 end
@@ -1,38 +1,38
1 # encoding: UTF-8
1 # encoding: UTF-8
2 # This file is auto-generated from the current state of the database. Instead
2 # This file is auto-generated from the current state of the database. Instead
3 # of editing this file, please use the migrations feature of Active Record to
3 # of editing this file, please use the migrations feature of Active Record to
4 # incrementally modify your database, and then regenerate this schema definition.
4 # incrementally modify your database, and then regenerate this schema definition.
5 #
5 #
6 # Note that this schema.rb definition is the authoritative source for your
6 # Note that this schema.rb definition is the authoritative source for your
7 # database schema. If you need to create the application database on another
7 # database schema. If you need to create the application database on another
8 # system, you should be using db:schema:load, not running all the migrations
8 # system, you should be using db:schema:load, not running all the migrations
9 # from scratch. The latter is a flawed and unsustainable approach (the more migrations
9 # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10 # you'll amass, the slower it'll run and the greater likelihood for issues).
10 # you'll amass, the slower it'll run and the greater likelihood for issues).
11 #
11 #
12 # It's strongly recommended that you check this file into your version control system.
12 # It's strongly recommended that you check this file into your version control system.
13
13
14 - ActiveRecord::Schema.define(version: 20170911091143) do
14 + ActiveRecord::Schema.define(version: 20170914150742) do
15
15
16 create_table "announcements", force: :cascade do |t|
16 create_table "announcements", force: :cascade do |t|
17 t.string "author", limit: 255
17 t.string "author", limit: 255
18 t.text "body", limit: 65535
18 t.text "body", limit: 65535
19 t.boolean "published"
19 t.boolean "published"
20 t.datetime "created_at", null: false
20 t.datetime "created_at", null: false
21 t.datetime "updated_at", null: false
21 t.datetime "updated_at", null: false
22 t.boolean "frontpage", default: false
22 t.boolean "frontpage", default: false
23 t.boolean "contest_only", default: false
23 t.boolean "contest_only", default: false
24 t.string "title", limit: 255
24 t.string "title", limit: 255
25 t.string "notes", limit: 255
25 t.string "notes", limit: 255
26 end
26 end
27
27
28 create_table "contests", force: :cascade do |t|
28 create_table "contests", force: :cascade do |t|
29 t.string "title", limit: 255
29 t.string "title", limit: 255
30 t.boolean "enabled"
30 t.boolean "enabled"
31 t.datetime "created_at", null: false
31 t.datetime "created_at", null: false
32 t.datetime "updated_at", null: false
32 t.datetime "updated_at", null: false
33 t.string "name", limit: 255
33 t.string "name", limit: 255
34 end
34 end
35
35
36 create_table "contests_problems", id: false, force: :cascade do |t|
36 create_table "contests_problems", id: false, force: :cascade do |t|
37 t.integer "contest_id", limit: 4
37 t.integer "contest_id", limit: 4
38 t.integer "problem_id", limit: 4
38 t.integer "problem_id", limit: 4
@@ -125,48 +125,57
125 create_table "messages", force: :cascade do |t|
125 create_table "messages", force: :cascade do |t|
126 t.integer "sender_id", limit: 4
126 t.integer "sender_id", limit: 4
127 t.integer "receiver_id", limit: 4
127 t.integer "receiver_id", limit: 4
128 t.integer "replying_message_id", limit: 4
128 t.integer "replying_message_id", limit: 4
129 t.text "body", limit: 65535
129 t.text "body", limit: 65535
130 t.boolean "replied"
130 t.boolean "replied"
131 t.datetime "created_at", null: false
131 t.datetime "created_at", null: false
132 t.datetime "updated_at", null: false
132 t.datetime "updated_at", null: false
133 end
133 end
134
134
135 create_table "problems", force: :cascade do |t|
135 create_table "problems", force: :cascade do |t|
136 t.string "name", limit: 30
136 t.string "name", limit: 30
137 t.string "full_name", limit: 255
137 t.string "full_name", limit: 255
138 t.integer "full_score", limit: 4
138 t.integer "full_score", limit: 4
139 t.date "date_added"
139 t.date "date_added"
140 t.boolean "available"
140 t.boolean "available"
141 t.string "url", limit: 255
141 t.string "url", limit: 255
142 t.integer "description_id", limit: 4
142 t.integer "description_id", limit: 4
143 t.boolean "test_allowed"
143 t.boolean "test_allowed"
144 t.boolean "output_only"
144 t.boolean "output_only"
145 t.string "description_filename", limit: 255
145 t.string "description_filename", limit: 255
146 t.boolean "view_testcase"
146 t.boolean "view_testcase"
147 end
147 end
148
148
149 + create_table "problems_tags", force: :cascade do |t|
150 + t.integer "problem_id", limit: 4
151 + t.integer "tag_id", limit: 4
152 + end
153 +
154 + add_index "problems_tags", ["problem_id", "tag_id"], name: "index_problems_tags_on_problem_id_and_tag_id", unique: true, using: :btree
155 + add_index "problems_tags", ["problem_id"], name: "index_problems_tags_on_problem_id", using: :btree
156 + add_index "problems_tags", ["tag_id"], name: "index_problems_tags_on_tag_id", using: :btree
157 +
149 create_table "rights", force: :cascade do |t|
158 create_table "rights", force: :cascade do |t|
150 t.string "name", limit: 255
159 t.string "name", limit: 255
151 t.string "controller", limit: 255
160 t.string "controller", limit: 255
152 t.string "action", limit: 255
161 t.string "action", limit: 255
153 end
162 end
154
163
155 create_table "rights_roles", id: false, force: :cascade do |t|
164 create_table "rights_roles", id: false, force: :cascade do |t|
156 t.integer "right_id", limit: 4
165 t.integer "right_id", limit: 4
157 t.integer "role_id", limit: 4
166 t.integer "role_id", limit: 4
158 end
167 end
159
168
160 add_index "rights_roles", ["role_id"], name: "index_rights_roles_on_role_id", using: :btree
169 add_index "rights_roles", ["role_id"], name: "index_rights_roles_on_role_id", using: :btree
161
170
162 create_table "roles", force: :cascade do |t|
171 create_table "roles", force: :cascade do |t|
163 t.string "name", limit: 255
172 t.string "name", limit: 255
164 end
173 end
165
174
166 create_table "roles_users", id: false, force: :cascade do |t|
175 create_table "roles_users", id: false, force: :cascade do |t|
167 t.integer "role_id", limit: 4
176 t.integer "role_id", limit: 4
168 t.integer "user_id", limit: 4
177 t.integer "user_id", limit: 4
169 end
178 end
170
179
171 add_index "roles_users", ["user_id"], name: "index_roles_users_on_user_id", using: :btree
180 add_index "roles_users", ["user_id"], name: "index_roles_users_on_user_id", using: :btree
172
181
@@ -198,48 +207,56
198
207
199 create_table "submissions", force: :cascade do |t|
208 create_table "submissions", force: :cascade do |t|
200 t.integer "user_id", limit: 4
209 t.integer "user_id", limit: 4
201 t.integer "problem_id", limit: 4
210 t.integer "problem_id", limit: 4
202 t.integer "language_id", limit: 4
211 t.integer "language_id", limit: 4
203 t.text "source", limit: 65535
212 t.text "source", limit: 65535
204 t.binary "binary", limit: 65535
213 t.binary "binary", limit: 65535
205 t.datetime "submitted_at"
214 t.datetime "submitted_at"
206 t.datetime "compiled_at"
215 t.datetime "compiled_at"
207 t.text "compiler_message", limit: 65535
216 t.text "compiler_message", limit: 65535
208 t.datetime "graded_at"
217 t.datetime "graded_at"
209 t.integer "points", limit: 4
218 t.integer "points", limit: 4
210 t.text "grader_comment", limit: 65535
219 t.text "grader_comment", limit: 65535
211 t.integer "number", limit: 4
220 t.integer "number", limit: 4
212 t.string "source_filename", limit: 255
221 t.string "source_filename", limit: 255
213 t.float "max_runtime", limit: 24
222 t.float "max_runtime", limit: 24
214 t.integer "peak_memory", limit: 4
223 t.integer "peak_memory", limit: 4
215 t.integer "effective_code_length", limit: 4
224 t.integer "effective_code_length", limit: 4
216 t.string "ip_address", limit: 255
225 t.string "ip_address", limit: 255
217 end
226 end
218
227
219 add_index "submissions", ["user_id", "problem_id", "number"], name: "index_submissions_on_user_id_and_problem_id_and_number", unique: true, using: :btree
228 add_index "submissions", ["user_id", "problem_id", "number"], name: "index_submissions_on_user_id_and_problem_id_and_number", unique: true, using: :btree
220 add_index "submissions", ["user_id", "problem_id"], name: "index_submissions_on_user_id_and_problem_id", using: :btree
229 add_index "submissions", ["user_id", "problem_id"], name: "index_submissions_on_user_id_and_problem_id", using: :btree
221
230
231 + create_table "tags", force: :cascade do |t|
232 + t.string "name", limit: 255, null: false
233 + t.text "description", limit: 65535
234 + t.boolean "public"
235 + t.datetime "created_at", null: false
236 + t.datetime "updated_at", null: false
237 + end
238 +
222 create_table "tasks", force: :cascade do |t|
239 create_table "tasks", force: :cascade do |t|
223 t.integer "submission_id", limit: 4
240 t.integer "submission_id", limit: 4
224 t.datetime "created_at"
241 t.datetime "created_at"
225 t.integer "status", limit: 4
242 t.integer "status", limit: 4
226 t.datetime "updated_at"
243 t.datetime "updated_at"
227 end
244 end
228
245
229 add_index "tasks", ["submission_id"], name: "index_tasks_on_submission_id", using: :btree
246 add_index "tasks", ["submission_id"], name: "index_tasks_on_submission_id", using: :btree
230
247
231 create_table "test_pairs", force: :cascade do |t|
248 create_table "test_pairs", force: :cascade do |t|
232 t.integer "problem_id", limit: 4
249 t.integer "problem_id", limit: 4
233 t.text "input", limit: 16777215
250 t.text "input", limit: 16777215
234 t.text "solution", limit: 16777215
251 t.text "solution", limit: 16777215
235 t.datetime "created_at", null: false
252 t.datetime "created_at", null: false
236 t.datetime "updated_at", null: false
253 t.datetime "updated_at", null: false
237 end
254 end
238
255
239 create_table "test_requests", force: :cascade do |t|
256 create_table "test_requests", force: :cascade do |t|
240 t.integer "user_id", limit: 4
257 t.integer "user_id", limit: 4
241 t.integer "problem_id", limit: 4
258 t.integer "problem_id", limit: 4
242 t.integer "submission_id", limit: 4
259 t.integer "submission_id", limit: 4
243 t.string "input_file_name", limit: 255
260 t.string "input_file_name", limit: 255
244 t.string "output_file_name", limit: 255
261 t.string "output_file_name", limit: 255
245 t.string "running_stat", limit: 255
262 t.string "running_stat", limit: 255
@@ -278,25 +295,27
278 t.datetime "updated_at", null: false
295 t.datetime "updated_at", null: false
279 t.boolean "forced_logout"
296 t.boolean "forced_logout"
280 end
297 end
281
298
282 create_table "users", force: :cascade do |t|
299 create_table "users", force: :cascade do |t|
283 t.string "login", limit: 50
300 t.string "login", limit: 50
284 t.string "full_name", limit: 255
301 t.string "full_name", limit: 255
285 t.string "hashed_password", limit: 255
302 t.string "hashed_password", limit: 255
286 t.string "salt", limit: 5
303 t.string "salt", limit: 5
287 t.string "alias", limit: 255
304 t.string "alias", limit: 255
288 t.string "email", limit: 255
305 t.string "email", limit: 255
289 t.integer "site_id", limit: 4
306 t.integer "site_id", limit: 4
290 t.integer "country_id", limit: 4
307 t.integer "country_id", limit: 4
291 t.boolean "activated", default: false
308 t.boolean "activated", default: false
292 t.datetime "created_at"
309 t.datetime "created_at"
293 t.datetime "updated_at"
310 t.datetime "updated_at"
294 t.boolean "enabled", default: true
311 t.boolean "enabled", default: true
295 t.string "remark", limit: 255
312 t.string "remark", limit: 255
296 t.string "last_ip", limit: 255
313 t.string "last_ip", limit: 255
297 t.string "section", limit: 255
314 t.string "section", limit: 255
298 end
315 end
299
316
300 add_index "users", ["login"], name: "index_users_on_login", unique: true, using: :btree
317 add_index "users", ["login"], name: "index_users_on_login", unique: true, using: :btree
301
318
319 + add_foreign_key "problems_tags", "problems"
320 + add_foreign_key "problems_tags", "tags"
302 end
321 end
You need to be logged in to leave comments. Login now