schema.rb 13.3 KB
Newer Older
G
gitlabhq 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.

A
Andrew8xx8 已提交
14
ActiveRecord::Schema.define(:version => 20130220133245) do
15

D
Dmitriy Zaporozhets 已提交
16
  create_table "events", :force => true do |t|
17 18
    t.string   "target_type"
    t.integer  "target_id"
D
Dmitriy Zaporozhets 已提交
19 20 21
    t.string   "title"
    t.text     "data"
    t.integer  "project_id"
22 23 24
    t.datetime "created_at",  :null => false
    t.datetime "updated_at",  :null => false
    t.integer  "action"
25
    t.integer  "author_id"
D
Dmitriy Zaporozhets 已提交
26
  end
27

28 29
  add_index "events", ["action"], :name => "index_events_on_action"
  add_index "events", ["author_id"], :name => "index_events_on_author_id"
R
Riyad Preukschas 已提交
30
  add_index "events", ["created_at"], :name => "index_events_on_created_at"
31
  add_index "events", ["project_id"], :name => "index_events_on_project_id"
R
Riyad Preukschas 已提交
32
  add_index "events", ["target_id"], :name => "index_events_on_target_id"
33 34
  add_index "events", ["target_type"], :name => "index_events_on_target_type"

G
gitlabhq 已提交
35 36 37 38 39
  create_table "issues", :force => true do |t|
    t.string   "title"
    t.integer  "assignee_id"
    t.integer  "author_id"
    t.integer  "project_id"
40 41
    t.datetime "created_at",                  :null => false
    t.datetime "updated_at",                  :null => false
D
Dmitriy Zaporozhets 已提交
42
    t.integer  "position",     :default => 0
G
gitlabhq 已提交
43
    t.string   "branch_name"
44
    t.text     "description"
D
Dmitriy Zaporozhets 已提交
45
    t.integer  "milestone_id"
46
    t.string   "state"
G
gitlabhq 已提交
47 48
  end

49 50
  add_index "issues", ["assignee_id"], :name => "index_issues_on_assignee_id"
  add_index "issues", ["author_id"], :name => "index_issues_on_author_id"
R
Riyad Preukschas 已提交
51
  add_index "issues", ["created_at"], :name => "index_issues_on_created_at"
52
  add_index "issues", ["milestone_id"], :name => "index_issues_on_milestone_id"
V
Valery Sizov 已提交
53
  add_index "issues", ["project_id"], :name => "index_issues_on_project_id"
R
Riyad Preukschas 已提交
54
  add_index "issues", ["title"], :name => "index_issues_on_title"
V
Valery Sizov 已提交
55

G
gitlabhq 已提交
56
  create_table "keys", :force => true do |t|
M
miks 已提交
57
    t.integer  "user_id"
58 59
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
G
gitlabhq 已提交
60 61 62
    t.text     "key"
    t.string   "title"
    t.string   "identifier"
M
miks 已提交
63
    t.integer  "project_id"
G
gitlabhq 已提交
64 65
  end

R
Riyad Preukschas 已提交
66 67
  add_index "keys", ["identifier"], :name => "index_keys_on_identifier"
  add_index "keys", ["project_id"], :name => "index_keys_on_project_id"
68 69
  add_index "keys", ["user_id"], :name => "index_keys_on_user_id"

D
Dmitriy Zaporozhets 已提交
70
  create_table "merge_requests", :force => true do |t|
A
Andrew8xx8 已提交
71 72 73
    t.string   "target_branch",                       :null => false
    t.string   "source_branch",                       :null => false
    t.integer  "project_id",                          :null => false
D
Dmitriy Zaporozhets 已提交
74 75 76
    t.integer  "author_id"
    t.integer  "assignee_id"
    t.string   "title"
A
Andrew8xx8 已提交
77 78
    t.datetime "created_at",                          :null => false
    t.datetime "updated_at",                          :null => false
79 80
    t.text     "st_commits",    :limit => 2147483647
    t.text     "st_diffs",      :limit => 2147483647
81
    t.integer  "milestone_id"
82
    t.string   "state"
A
Andrew8xx8 已提交
83
    t.string   "merge_status"
D
Dmitriy Zaporozhets 已提交
84 85
  end

86 87
  add_index "merge_requests", ["assignee_id"], :name => "index_merge_requests_on_assignee_id"
  add_index "merge_requests", ["author_id"], :name => "index_merge_requests_on_author_id"
R
Riyad Preukschas 已提交
88
  add_index "merge_requests", ["created_at"], :name => "index_merge_requests_on_created_at"
89
  add_index "merge_requests", ["milestone_id"], :name => "index_merge_requests_on_milestone_id"
V
Valery Sizov 已提交
90
  add_index "merge_requests", ["project_id"], :name => "index_merge_requests_on_project_id"
R
Riyad Preukschas 已提交
91 92 93
  add_index "merge_requests", ["source_branch"], :name => "index_merge_requests_on_source_branch"
  add_index "merge_requests", ["target_branch"], :name => "index_merge_requests_on_target_branch"
  add_index "merge_requests", ["title"], :name => "index_merge_requests_on_title"
V
Valery Sizov 已提交
94

D
Dmitriy Zaporozhets 已提交
95
  create_table "milestones", :force => true do |t|
96 97
    t.string   "title",       :null => false
    t.integer  "project_id",  :null => false
D
Dmitriy Zaporozhets 已提交
98
    t.text     "description"
99
    t.date     "due_date"
100 101 102
    t.datetime "created_at",  :null => false
    t.datetime "updated_at",  :null => false
    t.string   "state"
D
Dmitriy Zaporozhets 已提交
103 104
  end

R
Riyad Preukschas 已提交
105 106 107
  add_index "milestones", ["due_date"], :name => "index_milestones_on_due_date"
  add_index "milestones", ["project_id"], :name => "index_milestones_on_project_id"

108
  create_table "namespaces", :force => true do |t|
A
Andrew8xx8 已提交
109 110 111 112 113
    t.string   "name",                        :null => false
    t.string   "path",                        :null => false
    t.integer  "owner_id",                    :null => false
    t.datetime "created_at",                  :null => false
    t.datetime "updated_at",                  :null => false
114
    t.string   "type"
A
Andrew8xx8 已提交
115
    t.string   "description", :default => "", :null => false
116 117
  end

R
Riyad Preukschas 已提交
118
  add_index "namespaces", ["name"], :name => "index_namespaces_on_name"
119
  add_index "namespaces", ["owner_id"], :name => "index_namespaces_on_owner_id"
R
Riyad Preukschas 已提交
120 121
  add_index "namespaces", ["path"], :name => "index_namespaces_on_path"
  add_index "namespaces", ["type"], :name => "index_namespaces_on_type"
122

G
gitlabhq 已提交
123
  create_table "notes", :force => true do |t|
G
gitlabhq 已提交
124
    t.text     "note"
G
gitlabhq 已提交
125 126
    t.string   "noteable_type"
    t.integer  "author_id"
127 128
    t.datetime "created_at",    :null => false
    t.datetime "updated_at",    :null => false
G
gitlabhq 已提交
129 130
    t.integer  "project_id"
    t.string   "attachment"
D
Dmitriy Zaporozhets 已提交
131
    t.string   "line_code"
132 133
    t.string   "commit_id"
    t.integer  "noteable_id"
G
gitlabhq 已提交
134 135
  end

136
  add_index "notes", ["commit_id"], :name => "index_notes_on_commit_id"
R
Riyad Preukschas 已提交
137
  add_index "notes", ["created_at"], :name => "index_notes_on_created_at"
V
Valery Sizov 已提交
138
  add_index "notes", ["noteable_type"], :name => "index_notes_on_noteable_type"
139
  add_index "notes", ["project_id", "noteable_type"], :name => "index_notes_on_project_id_and_noteable_type"
140
  add_index "notes", ["project_id"], :name => "index_notes_on_project_id"
V
Valery Sizov 已提交
141

G
gitlabhq 已提交
142 143 144 145
  create_table "projects", :force => true do |t|
    t.string   "name"
    t.string   "path"
    t.text     "description"
A
Andrew8xx8 已提交
146 147
    t.datetime "created_at",                                   :null => false
    t.datetime "updated_at",                                   :null => false
148
    t.integer  "creator_id"
149
    t.string   "default_branch"
A
Andrew8xx8 已提交
150 151 152 153
    t.boolean  "issues_enabled",         :default => true,     :null => false
    t.boolean  "wall_enabled",           :default => true,     :null => false
    t.boolean  "merge_requests_enabled", :default => true,     :null => false
    t.boolean  "wiki_enabled",           :default => true,     :null => false
154
    t.integer  "namespace_id"
A
Andrew8xx8 已提交
155
    t.boolean  "public",                 :default => false,    :null => false
A
Andrew8xx8 已提交
156 157
    t.string   "issues_tracker",         :default => "gitlab", :null => false
    t.string   "issues_tracker_id"
G
gitlabhq 已提交
158 159
  end

160
  add_index "projects", ["creator_id"], :name => "index_projects_on_owner_id"
161 162
  add_index "projects", ["namespace_id"], :name => "index_projects_on_namespace_id"

163 164 165 166 167 168 169
  create_table "protected_branches", :force => true do |t|
    t.integer  "project_id", :null => false
    t.string   "name",       :null => false
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
  end

D
Dmitriy Zaporozhets 已提交
170 171 172 173
  create_table "services", :force => true do |t|
    t.string   "type"
    t.string   "title"
    t.string   "token"
D
Dmitriy Zaporozhets 已提交
174 175 176 177 178
    t.integer  "project_id",                     :null => false
    t.datetime "created_at",                     :null => false
    t.datetime "updated_at",                     :null => false
    t.boolean  "active",      :default => false, :null => false
    t.string   "project_url"
D
Dmitriy Zaporozhets 已提交
179 180
  end

181 182
  add_index "services", ["project_id"], :name => "index_services_on_project_id"

G
gitlabhq 已提交
183 184 185 186 187
  create_table "snippets", :force => true do |t|
    t.string   "title"
    t.text     "content"
    t.integer  "author_id",  :null => false
    t.integer  "project_id", :null => false
188 189
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
G
gitlabhq 已提交
190
    t.string   "file_name"
N
Nihad Abbasov 已提交
191
    t.datetime "expires_at"
G
gitlabhq 已提交
192 193
  end

R
Riyad Preukschas 已提交
194 195
  add_index "snippets", ["created_at"], :name => "index_snippets_on_created_at"
  add_index "snippets", ["expires_at"], :name => "index_snippets_on_expires_at"
196 197
  add_index "snippets", ["project_id"], :name => "index_snippets_on_project_id"

A
Aleksei Kvitinskii 已提交
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
  create_table "taggings", :force => true do |t|
    t.integer  "tag_id"
    t.integer  "taggable_id"
    t.string   "taggable_type"
    t.integer  "tagger_id"
    t.string   "tagger_type"
    t.string   "context"
    t.datetime "created_at"
  end

  add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id"
  add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context"

  create_table "tags", :force => true do |t|
    t.string "name"
  end

215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235
  create_table "user_team_project_relationships", :force => true do |t|
    t.integer  "project_id"
    t.integer  "user_team_id"
    t.integer  "greatest_access"
    t.datetime "created_at",      :null => false
    t.datetime "updated_at",      :null => false
  end

  create_table "user_team_user_relationships", :force => true do |t|
    t.integer  "user_id"
    t.integer  "user_team_id"
    t.boolean  "group_admin"
    t.integer  "permission"
    t.datetime "created_at",   :null => false
    t.datetime "updated_at",   :null => false
  end

  create_table "user_teams", :force => true do |t|
    t.string   "name"
    t.string   "path"
    t.integer  "owner_id"
A
Andrew8xx8 已提交
236 237
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
238 239
  end

G
gitlabhq 已提交
240
  create_table "users", :force => true do |t|
R
randx 已提交
241 242
    t.string   "email",                  :default => "",    :null => false
    t.string   "encrypted_password",     :default => "",    :null => false
G
gitlabhq 已提交
243 244 245
    t.string   "reset_password_token"
    t.datetime "reset_password_sent_at"
    t.datetime "remember_created_at"
R
randx 已提交
246
    t.integer  "sign_in_count",          :default => 0
G
gitlabhq 已提交
247 248 249 250
    t.datetime "current_sign_in_at"
    t.datetime "last_sign_in_at"
    t.string   "current_sign_in_ip"
    t.string   "last_sign_in_ip"
R
randx 已提交
251 252
    t.datetime "created_at",                                :null => false
    t.datetime "updated_at",                                :null => false
G
gitlabhq 已提交
253
    t.string   "name"
R
randx 已提交
254 255 256 257 258
    t.boolean  "admin",                  :default => false, :null => false
    t.integer  "projects_limit",         :default => 10
    t.string   "skype",                  :default => "",    :null => false
    t.string   "linkedin",               :default => "",    :null => false
    t.string   "twitter",                :default => "",    :null => false
N
Nihad Abbasov 已提交
259
    t.string   "authentication_token"
R
randx 已提交
260 261
    t.boolean  "dark_scheme",            :default => false, :null => false
    t.integer  "theme_id",               :default => 1,     :null => false
262
    t.string   "bio"
R
randx 已提交
263 264
    t.boolean  "blocked",                :default => false, :null => false
    t.integer  "failed_attempts",        :default => 0
265
    t.datetime "locked_at"
266 267
    t.string   "extern_uid"
    t.string   "provider"
268
    t.string   "username"
269 270
    t.boolean  "can_create_group",       :default => true,  :null => false
    t.boolean  "can_create_team",        :default => true,  :null => false
G
gitlabhq 已提交
271 272
  end

R
Riyad Preukschas 已提交
273 274
  add_index "users", ["admin"], :name => "index_users_on_admin"
  add_index "users", ["blocked"], :name => "index_users_on_blocked"
G
gitlabhq 已提交
275
  add_index "users", ["email"], :name => "index_users_on_email", :unique => true
276
  add_index "users", ["extern_uid", "provider"], :name => "index_users_on_extern_uid_and_provider", :unique => true
R
Riyad Preukschas 已提交
277
  add_index "users", ["name"], :name => "index_users_on_name"
G
gitlabhq 已提交
278
  add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
R
Riyad Preukschas 已提交
279
  add_index "users", ["username"], :name => "index_users_on_username"
G
gitlabhq 已提交
280 281 282 283

  create_table "users_projects", :force => true do |t|
    t.integer  "user_id",                       :null => false
    t.integer  "project_id",                    :null => false
284 285
    t.datetime "created_at",                    :null => false
    t.datetime "updated_at",                    :null => false
286
    t.integer  "project_access", :default => 0, :null => false
G
gitlabhq 已提交
287 288
  end

R
Riyad Preukschas 已提交
289
  add_index "users_projects", ["project_access"], :name => "index_users_projects_on_project_access"
290
  add_index "users_projects", ["project_id"], :name => "index_users_projects_on_project_id"
R
Riyad Preukschas 已提交
291
  add_index "users_projects", ["user_id"], :name => "index_users_projects_on_user_id"
292

A
Ariejan de Vroom 已提交
293 294 295
  create_table "web_hooks", :force => true do |t|
    t.string   "url"
    t.integer  "project_id"
296 297 298
    t.datetime "created_at",                            :null => false
    t.datetime "updated_at",                            :null => false
    t.string   "type",       :default => "ProjectHook"
D
Dmitriy Zaporozhets 已提交
299
    t.integer  "service_id"
A
Ariejan de Vroom 已提交
300 301
  end

V
Valery Sizov 已提交
302 303 304 305 306 307 308
  create_table "wikis", :force => true do |t|
    t.string   "title"
    t.text     "content"
    t.integer  "project_id"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
    t.string   "slug"
V
Valery Sizov 已提交
309
    t.integer  "user_id"
V
Valery Sizov 已提交
310 311
  end

R
Riyad Preukschas 已提交
312 313 314
  add_index "wikis", ["project_id"], :name => "index_wikis_on_project_id"
  add_index "wikis", ["slug"], :name => "index_wikis_on_slug"

G
gitlabhq 已提交
315
end