Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
e8f8abdd
Commit
e8f8abdd
authored
Feb 04, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Squash migrations for years 2011 and 2012
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
32b9ec50
Changes
92
Show whitespace changes
Inline
Side-by-side
Showing
92 changed files
with
306 additions
and
895 deletions
+306
-895
db/migrate/20110913200833_devise_create_users.rb
db/migrate/20110913200833_devise_create_users.rb
+0
-55
db/migrate/20110913204141_create_projects.rb
db/migrate/20110913204141_create_projects.rb
+0
-11
db/migrate/20110914221600_create_users_projects.rb
db/migrate/20110914221600_create_users_projects.rb
+0
-13
db/migrate/20110915205627_add_private_flag_to_project.rb
db/migrate/20110915205627_add_private_flag_to_project.rb
+0
-5
db/migrate/20110915213352_create_keys.rb
db/migrate/20110915213352_create_keys.rb
+0
-9
db/migrate/20110916123731_add_name_to_user.rb
db/migrate/20110916123731_add_name_to_user.rb
+0
-5
db/migrate/20110916162511_add_key_title_to_key.rb
db/migrate/20110916162511_add_key_title_to_key.rb
+0
-7
db/migrate/20110917212932_add_identifier_to_key.rb
db/migrate/20110917212932_add_identifier_to_key.rb
+0
-5
db/migrate/20110921192501_create_issues.rb
db/migrate/20110921192501_create_issues.rb
+0
-13
db/migrate/20110922110156_add_code_to_project.rb
db/migrate/20110922110156_add_code_to_project.rb
+0
-5
db/migrate/20110923211333_add_status_to_issue.rb
db/migrate/20110923211333_add_status_to_issue.rb
+0
-5
db/migrate/20110924214549_create_rails_admin_histories_table.rb
...rate/20110924214549_create_rails_admin_histories_table.rb
+0
-18
db/migrate/20110924215658_add_admin_field_to_user.rb
db/migrate/20110924215658_add_admin_field_to_user.rb
+0
-5
db/migrate/20110926082616_remove_admin.rb
db/migrate/20110926082616_remove_admin.rb
+0
-9
db/migrate/20110927130352_create_notes.rb
db/migrate/20110927130352_create_notes.rb
+0
-12
db/migrate/20110928140106_add_project_id_for_note.rb
db/migrate/20110928140106_add_project_id_for_note.rb
+0
-9
db/migrate/20110928142747_change_noteable_id_for_note.rb
db/migrate/20110928142747_change_noteable_id_for_note.rb
+0
-9
db/migrate/20110928161328_add_attachment_to_note.rb
db/migrate/20110928161328_add_attachment_to_note.rb
+0
-5
db/migrate/20111005193700_add_allow_repo_creation_for_user.rb
...igrate/20111005193700_add_allow_repo_creation_for_user.rb
+0
-9
db/migrate/20111009101738_add_ownerto_project.rb
db/migrate/20111009101738_add_ownerto_project.rb
+0
-5
db/migrate/20111009110913_add_projects_limit_to_user.rb
db/migrate/20111009110913_add_projects_limit_to_user.rb
+0
-5
db/migrate/20111009111204_remove_allow_create_repo_from_user.rb
...rate/20111009111204_remove_allow_create_repo_from_user.rb
+0
-9
db/migrate/20111015154310_add_position_to_issues.rb
db/migrate/20111015154310_add_position_to_issues.rb
+0
-5
db/migrate/20111016183422_create_snippets.rb
db/migrate/20111016183422_create_snippets.rb
+0
-12
db/migrate/20111016193417_add_content_type_to_snippets.rb
db/migrate/20111016193417_add_content_type_to_snippets.rb
+0
-5
db/migrate/20111016195506_add_file_name_to_snippets.rb
db/migrate/20111016195506_add_file_name_to_snippets.rb
+0
-6
db/migrate/20111019212429_add_social_to_user.rb
db/migrate/20111019212429_add_social_to_user.rb
+0
-7
db/migrate/20111021101550_change_social_fields_in_users.rb
db/migrate/20111021101550_change_social_fields_in_users.rb
+0
-14
db/migrate/20111025134235_add_high_label_to_issue.rb
db/migrate/20111025134235_add_high_label_to_issue.rb
+0
-5
db/migrate/20111027051828_add_expires_at_to_snippets.rb
db/migrate/20111027051828_add_expires_at_to_snippets.rb
+0
-5
db/migrate/20111027142641_change_note_note_to_text.rb
db/migrate/20111027142641_change_note_note_to_text.rb
+0
-8
db/migrate/20111027152724_issue_conten_to_note.rb
db/migrate/20111027152724_issue_conten_to_note.rb
+0
-34
db/migrate/20111101222453_acts_as_taggable_on_migration.rb
db/migrate/20111101222453_acts_as_taggable_on_migration.rb
+0
-28
db/migrate/20111111093150_remove_content_from_issues.rb
db/migrate/20111111093150_remove_content_from_issues.rb
+0
-9
db/migrate/20111115063954_add_authentication_token_to_users.rb
...grate/20111115063954_add_authentication_token_to_users.rb
+0
-5
db/migrate/20111124115339_add_extra_field_to_issue.rb
db/migrate/20111124115339_add_extra_field_to_issue.rb
+0
-5
db/migrate/20111127155345_create_merge_requests.rb
db/migrate/20111127155345_create_merge_requests.rb
+0
-15
db/migrate/20111206213842_add_advanced_rights_to_team_member.rb
...rate/20111206213842_add_advanced_rights_to_team_member.rb
+0
-6
db/migrate/20111206222316_migrate_to_new_rights.rb
db/migrate/20111206222316_migrate_to_new_rights.rb
+0
-20
db/migrate/20111207211728_add_default_branch_to_project.rb
db/migrate/20111207211728_add_default_branch_to_project.rb
+0
-5
db/migrate/20111214091851_create_web_hooks.rb
db/migrate/20111214091851_create_web_hooks.rb
+0
-9
db/migrate/20111220190817_add_coloscheme_option_to_user.rb
db/migrate/20111220190817_add_coloscheme_option_to_user.rb
+0
-5
db/migrate/20111231111825_add_project_id_to_key.rb
db/migrate/20111231111825_add_project_id_to_key.rb
+0
-6
db/migrate/20120110180749_add_line_number_to_note.rb
db/migrate/20120110180749_add_line_number_to_note.rb
+0
-5
db/migrate/20120119202326_add_indexes.rb
db/migrate/20120119202326_add_indexes.rb
+0
-9
db/migrate/20120121122616_fix_noteable_id.rb
db/migrate/20120121122616_fix_noteable_id.rb
+0
-8
db/migrate/20120206170141_add_modularity_fields_to_project.rb
...igrate/20120206170141_add_modularity_fields_to_project.rb
+0
-7
db/migrate/20120215182305_create_protected_branches.rb
db/migrate/20120215182305_create_protected_branches.rb
+0
-10
db/migrate/20120216085842_move_to_roles_permissions.rb
db/migrate/20120216085842_move_to_roles_permissions.rb
+0
-22
db/migrate/20120216215008_create_wikis.rb
db/migrate/20120216215008_create_wikis.rb
+0
-11
db/migrate/20120219130957_add_slug_to_wiki.rb
db/migrate/20120219130957_add_slug_to_wiki.rb
+0
-6
db/migrate/20120219140810_add_wiki_enabled_to_project.rb
db/migrate/20120219140810_add_wiki_enabled_to_project.rb
+0
-6
db/migrate/20120219193300_add_user_to_wiki.rb
db/migrate/20120219193300_add_user_to_wiki.rb
+0
-6
db/migrate/20120228130210_create_events.rb
db/migrate/20120228130210_create_events.rb
+0
-14
db/migrate/20120228134252_add_action_to_event.rb
db/migrate/20120228134252_add_action_to_event.rb
+0
-5
db/migrate/20120301185805_add_theme_to_user.rb
db/migrate/20120301185805_add_theme_to_user.rb
+0
-6
db/migrate/20120307095918_add_author_id_to_event.rb
db/migrate/20120307095918_add_author_id_to_event.rb
+0
-5
db/migrate/20120315111711_add_commits_diff_store_to_merge_request.rb
...20120315111711_add_commits_diff_store_to_merge_request.rb
+0
-6
db/migrate/20120315132931_add_merged_to_merge_request.rb
db/migrate/20120315132931_add_merged_to_merge_request.rb
+0
-5
db/migrate/20120317095543_add_description_to_issues.rb
db/migrate/20120317095543_add_description_to_issues.rb
+0
-5
db/migrate/20120323221339_add_bio_field_to_user.rb
db/migrate/20120323221339_add_bio_field_to_user.rb
+0
-5
db/migrate/20120329170745_add_automerge_to_merge_request.rb
db/migrate/20120329170745_add_automerge_to_merge_request.rb
+0
-5
db/migrate/20120405211750_increase_mr_text_column_size.rb
db/migrate/20120405211750_increase_mr_text_column_size.rb
+0
-10
db/migrate/20120408180246_create_milestones.rb
db/migrate/20120408180246_create_milestones.rb
+0
-12
db/migrate/20120408181910_add_milestone_id_to_issue.rb
db/migrate/20120408181910_add_milestone_id_to_issue.rb
+0
-5
db/migrate/20120413135904_add_blocked_field_to_user.rb
db/migrate/20120413135904_add_blocked_field_to_user.rb
+0
-5
db/migrate/20120627145613_remove_critical_from_issue.rb
db/migrate/20120627145613_remove_critical_from_issue.rb
+0
-9
db/migrate/20120706065612_add_lockable_to_users.rb
db/migrate/20120706065612_add_lockable_to_users.rb
+0
-6
db/migrate/20120712080407_add_type_to_web_hook.rb
db/migrate/20120712080407_add_type_to_web_hook.rb
+0
-5
db/migrate/20120729131232_add_extern_auth_provider_to_users.rb
...grate/20120729131232_add_extern_auth_provider_to_users.rb
+0
-8
db/migrate/20120905043334_set_default_branch_default_to_nil.rb
...grate/20120905043334_set_default_branch_default_to_nil.rb
+0
-12
db/migrate/20121002150926_create_groups.rb
db/migrate/20121002150926_create_groups.rb
+0
-11
db/migrate/20121002151033_add_group_id_to_project.rb
db/migrate/20121002151033_add_group_id_to_project.rb
+0
-5
db/migrate/20121009205010_postgres_create_integer_cast.rb
db/migrate/20121009205010_postgres_create_integer_cast.rb
+0
-15
db/migrate/20121026114600_add_milestone_id_to_merge_requests.rb
...rate/20121026114600_add_milestone_id_to_merge_requests.rb
+0
-5
db/migrate/20121119170638_create_services.rb
db/migrate/20121119170638_create_services.rb
+0
-12
db/migrate/20121120051432_add_service_id_to_web_hook.rb
db/migrate/20121120051432_add_service_id_to_web_hook.rb
+0
-5
db/migrate/20121120103700_add_active_to_service.rb
db/migrate/20121120103700_add_active_to_service.rb
+0
-5
db/migrate/20121120113838_add_project_url_to_service.rb
db/migrate/20121120113838_add_project_url_to_service.rb
+0
-5
db/migrate/20121122145155_convert_group_to_namespace.rb
db/migrate/20121122145155_convert_group_to_namespace.rb
+0
-13
db/migrate/20121122150932_add_namespace_id_to_project.rb
db/migrate/20121122150932_add_namespace_id_to_project.rb
+0
-5
db/migrate/20121123104937_add_username_to_user.rb
db/migrate/20121123104937_add_username_to_user.rb
+0
-5
db/migrate/20121123164910_rename_code_to_path.rb
db/migrate/20121123164910_rename_code_to_path.rb
+0
-11
db/migrate/20121203154450_add_events_indices.rb
db/migrate/20121203154450_add_events_indices.rb
+0
-8
db/migrate/20121203160507_more_indices.rb
db/migrate/20121203160507_more_indices.rb
+0
-26
db/migrate/20121205201726_add_more_indexes.rb
db/migrate/20121205201726_add_more_indexes.rb
+0
-44
db/migrate/20121218164840_move_noteable_commit_to_own_field.rb
...grate/20121218164840_move_noteable_commit_to_own_field.rb
+0
-20
db/migrate/20121219095402_indices_for_notes.rb
db/migrate/20121219095402_indices_for_notes.rb
+0
-6
db/migrate/20121219183753_create_user_teams.rb
db/migrate/20121219183753_create_user_teams.rb
+0
-11
db/migrate/20121220064104_create_user_team_project_relationships.rb
.../20121220064104_create_user_team_project_relationships.rb
+0
-11
db/migrate/20121220064453_create_user_team_user_relationships.rb
...ate/20121220064453_create_user_team_user_relationships.rb
+0
-12
db/migrate/20121220064453_init_schema.rb
db/migrate/20121220064453_init_schema.rb
+306
-0
No files found.
db/migrate/20110913200833_devise_create_users.rb
deleted
100644 → 0
View file @
32b9ec50
class
DeviseCreateUsers
<
ActiveRecord
::
Migration
def
self
.
up
create_table
(
:users
)
do
|
t
|
## Database authenticatable
t
.
string
:email
,
:null
=>
false
,
:default
=>
""
t
.
string
:encrypted_password
,
:null
=>
false
,
:default
=>
""
## Recoverable
t
.
string
:reset_password_token
t
.
datetime
:reset_password_sent_at
## Rememberable
t
.
datetime
:remember_created_at
## Trackable
t
.
integer
:sign_in_count
,
:default
=>
0
t
.
datetime
:current_sign_in_at
t
.
datetime
:last_sign_in_at
t
.
string
:current_sign_in_ip
t
.
string
:last_sign_in_ip
## Encryptable
# t.string :password_salt
## Confirmable
# t.string :confirmation_token
# t.datetime :confirmed_at
# t.datetime :confirmation_sent_at
# t.string :unconfirmed_email # Only if using reconfirmable
## Lockable
# t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
# t.string :unlock_token # Only if unlock strategy is :email or :both
# t.datetime :locked_at
# Token authenticatable
# t.string :authentication_token
## Invitable
# t.string :invitation_token
t
.
timestamps
end
add_index
:users
,
:email
,
:unique
=>
true
add_index
:users
,
:reset_password_token
,
:unique
=>
true
# add_index :users, :confirmation_token, :unique => true
# add_index :users, :unlock_token, :unique => true
# add_index :users, :authentication_token, :unique => true
end
def
self
.
down
drop_table
:users
end
end
db/migrate/20110913204141_create_projects.rb
deleted
100644 → 0
View file @
32b9ec50
class
CreateProjects
<
ActiveRecord
::
Migration
def
change
create_table
:projects
do
|
t
|
t
.
string
:name
t
.
string
:path
t
.
text
:description
t
.
timestamps
end
end
end
db/migrate/20110914221600_create_users_projects.rb
deleted
100644 → 0
View file @
32b9ec50
class
CreateUsersProjects
<
ActiveRecord
::
Migration
def
change
create_table
:users_projects
do
|
t
|
t
.
integer
:user_id
,
:null
=>
false
t
.
integer
:project_id
,
:null
=>
false
t
.
boolean
:read
,
:default
=>
false
t
.
boolean
:write
,
:default
=>
false
t
.
boolean
:admin
,
:default
=>
false
t
.
timestamps
end
end
end
db/migrate/20110915205627_add_private_flag_to_project.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddPrivateFlagToProject
<
ActiveRecord
::
Migration
def
change
add_column
:projects
,
:private_flag
,
:boolean
,
:default
=>
true
,
:null
=>
false
end
end
db/migrate/20110915213352_create_keys.rb
deleted
100644 → 0
View file @
32b9ec50
class
CreateKeys
<
ActiveRecord
::
Migration
def
change
create_table
:keys
do
|
t
|
t
.
integer
:user_id
,
:null
=>
false
t
.
text
:project_id
,
:null
=>
false
t
.
timestamps
end
end
end
db/migrate/20110916123731_add_name_to_user.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddNameToUser
<
ActiveRecord
::
Migration
def
change
add_column
:users
,
:name
,
:string
end
end
db/migrate/20110916162511_add_key_title_to_key.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddKeyTitleToKey
<
ActiveRecord
::
Migration
def
change
add_column
:keys
,
:key
,
:text
add_column
:keys
,
:title
,
:string
remove_column
:keys
,
:project_id
end
end
db/migrate/20110917212932_add_identifier_to_key.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddIdentifierToKey
<
ActiveRecord
::
Migration
def
change
add_column
:keys
,
:identifier
,
:string
end
end
db/migrate/20110921192501_create_issues.rb
deleted
100644 → 0
View file @
32b9ec50
class
CreateIssues
<
ActiveRecord
::
Migration
def
change
create_table
:issues
do
|
t
|
t
.
string
:title
t
.
text
:content
t
.
integer
:assignee_id
t
.
integer
:author_id
t
.
integer
:project_id
t
.
timestamps
end
end
end
db/migrate/20110922110156_add_code_to_project.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddCodeToProject
<
ActiveRecord
::
Migration
def
change
add_column
:projects
,
:code
,
:string
end
end
db/migrate/20110923211333_add_status_to_issue.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddStatusToIssue
<
ActiveRecord
::
Migration
def
change
add_column
:issues
,
:closed
,
:boolean
,
:default
=>
false
,
:null
=>
false
end
end
db/migrate/20110924214549_create_rails_admin_histories_table.rb
deleted
100644 → 0
View file @
32b9ec50
class
CreateRailsAdminHistoriesTable
<
ActiveRecord
::
Migration
def
self
.
up
create_table
:rails_admin_histories
do
|
t
|
t
.
text
:message
# title, name, or object_id
t
.
string
:username
t
.
integer
:item
t
.
string
:table
t
.
integer
:month
,
:limit
=>
2
t
.
integer
:year
,
:limit
=>
5
t
.
timestamps
end
add_index
(
:rails_admin_histories
,
[
:item
,
:table
,
:month
,
:year
],
:name
=>
'index_rails_admin_histories'
)
end
def
self
.
down
drop_table
:rails_admin_histories
end
end
db/migrate/20110924215658_add_admin_field_to_user.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddAdminFieldToUser
<
ActiveRecord
::
Migration
def
change
add_column
:users
,
:admin
,
:boolean
,
:default
=>
false
,
:null
=>
false
end
end
db/migrate/20110926082616_remove_admin.rb
deleted
100644 → 0
View file @
32b9ec50
class
RemoveAdmin
<
ActiveRecord
::
Migration
def
up
drop_table
:rails_admin_histories
end
def
down
raise
"No rollback"
end
end
db/migrate/20110927130352_create_notes.rb
deleted
100644 → 0
View file @
32b9ec50
class
CreateNotes
<
ActiveRecord
::
Migration
def
change
create_table
:notes
do
|
t
|
t
.
string
:note
t
.
integer
:noteable_id
t
.
string
:noteable_type
t
.
integer
:author_id
t
.
timestamps
end
end
end
db/migrate/20110928140106_add_project_id_for_note.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddProjectIdForNote
<
ActiveRecord
::
Migration
def
up
add_column
:notes
,
:project_id
,
:integer
end
def
down
remove_column
:notes
,
:project_id
,
:integer
end
end
db/migrate/20110928142747_change_noteable_id_for_note.rb
deleted
100644 → 0
View file @
32b9ec50
class
ChangeNoteableIdForNote
<
ActiveRecord
::
Migration
def
up
change_column
:notes
,
:noteable_id
,
:string
end
def
down
change_column
:notes
,
:noteable_id
,
:integer
end
end
db/migrate/20110928161328_add_attachment_to_note.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddAttachmentToNote
<
ActiveRecord
::
Migration
def
change
add_column
:notes
,
:attachment
,
:string
end
end
db/migrate/20111005193700_add_allow_repo_creation_for_user.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddAllowRepoCreationForUser
<
ActiveRecord
::
Migration
def
up
add_column
:users
,
:allowed_create_repo
,
:boolean
,
:default
=>
true
,
:null
=>
false
end
def
down
remove_column
:users
,
:allowed_create_repo
end
end
db/migrate/20111009101738_add_ownerto_project.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddOwnertoProject
<
ActiveRecord
::
Migration
def
change
add_column
:projects
,
:owner_id
,
:integer
end
end
db/migrate/20111009110913_add_projects_limit_to_user.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddProjectsLimitToUser
<
ActiveRecord
::
Migration
def
change
add_column
:users
,
:projects_limit
,
:integer
,
:default
=>
10
end
end
db/migrate/20111009111204_remove_allow_create_repo_from_user.rb
deleted
100644 → 0
View file @
32b9ec50
class
RemoveAllowCreateRepoFromUser
<
ActiveRecord
::
Migration
def
up
remove_column
:users
,
:allowed_create_repo
end
def
down
add_column
:users
,
:allowed_create_repo
,
:boolean
,
:default
=>
true
,
:null
=>
false
end
end
db/migrate/20111015154310_add_position_to_issues.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddPositionToIssues
<
ActiveRecord
::
Migration
def
change
add_column
:issues
,
:position
,
:integer
,
:default
=>
0
end
end
db/migrate/20111016183422_create_snippets.rb
deleted
100644 → 0
View file @
32b9ec50
class
CreateSnippets
<
ActiveRecord
::
Migration
def
change
create_table
:snippets
do
|
t
|
t
.
string
:title
t
.
text
:content
t
.
integer
:author_id
,
:null
=>
false
t
.
integer
:project_id
,
:null
=>
false
t
.
timestamps
end
end
end
db/migrate/20111016193417_add_content_type_to_snippets.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddContentTypeToSnippets
<
ActiveRecord
::
Migration
def
change
add_column
:snippets
,
:content_type
,
:string
,
:null
=>
false
,
:default
=>
"txt"
end
end
db/migrate/20111016195506_add_file_name_to_snippets.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddFileNameToSnippets
<
ActiveRecord
::
Migration
def
change
add_column
:snippets
,
:file_name
,
:string
remove_column
:snippets
,
:content_type
end
end
db/migrate/20111019212429_add_social_to_user.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddSocialToUser
<
ActiveRecord
::
Migration
def
change
add_column
:users
,
:skype
,
:string
add_column
:users
,
:linkedin
,
:string
add_column
:users
,
:twitter
,
:string
end
end
db/migrate/20111021101550_change_social_fields_in_users.rb
deleted
100644 → 0
View file @
32b9ec50
class
ChangeSocialFieldsInUsers
<
ActiveRecord
::
Migration
def
up
remove_column
:users
,
:skype
remove_column
:users
,
:linkedin
remove_column
:users
,
:twitter
add_column
:users
,
:skype
,
:string
,
{
:null
=>
false
,
:default
=>
''
}
add_column
:users
,
:linkedin
,
:string
,
{
:null
=>
false
,
:default
=>
''
}
add_column
:users
,
:twitter
,
:string
,
{
:null
=>
false
,
:default
=>
''
}
end
def
down
end
end
db/migrate/20111025134235_add_high_label_to_issue.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddHighLabelToIssue
<
ActiveRecord
::
Migration
def
change
add_column
:issues
,
:critical
,
:boolean
,
:default
=>
false
,
:null
=>
false
end
end
db/migrate/20111027051828_add_expires_at_to_snippets.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddExpiresAtToSnippets
<
ActiveRecord
::
Migration
def
change
add_column
:snippets
,
:expires_at
,
:datetime
end
end
db/migrate/20111027142641_change_note_note_to_text.rb
deleted
100644 → 0
View file @
32b9ec50
class
ChangeNoteNoteToText
<
ActiveRecord
::
Migration
def
up
change_column
:notes
,
:note
,
:text
end
def
down
end
end
db/migrate/20111027152724_issue_conten_to_note.rb
deleted
100644 → 0
View file @
32b9ec50
class
IssueContenToNote
<
ActiveRecord
::
Migration
def
up
puts
"Issue content is deprecated -> move to notes"
Issue
.
find_each
(
:batch_size
=>
100
)
do
|
issue
|
next
if
issue
.
content
.
blank?
note
=
Note
.
new
(
:note
=>
issue
.
content
,
:project_id
=>
issue
.
project_id
,
:noteable
=>
issue
,
:created_at
=>
issue
.
created_at
,
:updated_at
=>
issue
.
created_at
)
note
.
author_id
=
issue
.
author_id
if
note
.
save
issue
.
update_attributes
(
:content
=>
nil
)
print
"."
else
print
"F"
end
end
total
=
Issue
.
where
(
"content is not null"
).
count
if
total
>
0
puts
"content of
#{
total
}
issues were not migrated"
else
puts
"Done"
end
end
def
down
end
end
db/migrate/20111101222453_acts_as_taggable_on_migration.rb
deleted
100644 → 0
View file @
32b9ec50
class
ActsAsTaggableOnMigration
<
ActiveRecord
::
Migration
def
self
.
up
create_table
:tags
do
|
t
|
t
.
string
:name
end
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
t
.
string
:context
t
.
datetime
:created_at
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
db/migrate/20111111093150_remove_content_from_issues.rb
deleted
100644 → 0
View file @
32b9ec50
class
RemoveContentFromIssues
<
ActiveRecord
::
Migration
def
up
remove_column
:issues
,
:content
end
def
down
add_column
:issues
,
:content
,
:text
end
end
db/migrate/20111115063954_add_authentication_token_to_users.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddAuthenticationTokenToUsers
<
ActiveRecord
::
Migration
def
change
add_column
:users
,
:authentication_token
,
:string
end
end
db/migrate/20111124115339_add_extra_field_to_issue.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddExtraFieldToIssue
<
ActiveRecord
::
Migration
def
change
add_column
:issues
,
:branch_name
,
:string
,
:null
=>
true
end
end
db/migrate/20111127155345_create_merge_requests.rb
deleted
100644 → 0
View file @
32b9ec50
class
CreateMergeRequests
<
ActiveRecord
::
Migration
def
change
create_table
:merge_requests
do
|
t
|
t
.
string
:target_branch
,
:null
=>
false
t
.
string
:source_branch
,
:null
=>
false
t
.
integer
:project_id
,
:null
=>
false
t
.
integer
:author_id
t
.
integer
:assignee_id
t
.
string
:title
t
.
boolean
:closed
,
:default
=>
false
,
:null
=>
false
t
.
timestamps
end
end
end
db/migrate/20111206213842_add_advanced_rights_to_team_member.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddAdvancedRightsToTeamMember
<
ActiveRecord
::
Migration
def
change
add_column
:users_projects
,
:repo_access
,
:integer
,
:default
=>
0
,
:null
=>
false
add_column
:users_projects
,
:project_access
,
:integer
,
:default
=>
0
,
:null
=>
false
end
end
db/migrate/20111206222316_migrate_to_new_rights.rb
deleted
100644 → 0
View file @
32b9ec50
class
MigrateToNewRights
<
ActiveRecord
::
Migration
def
up
# Repository access
UsersProject
.
update_all
(
"repo_access = 2"
,
:write
=>
true
)
UsersProject
.
update_all
(
"repo_access = 1"
,
:read
=>
true
,
:write
=>
false
)
# Project access
UsersProject
.
update_all
(
"project_access = 1"
,
:read
=>
true
,
:write
=>
false
,
:admin
=>
false
)
UsersProject
.
update_all
(
"project_access = 2"
,
:read
=>
true
,
:write
=>
true
,
:admin
=>
false
)
UsersProject
.
update_all
(
"project_access = 3"
,
:read
=>
true
,
:write
=>
true
,
:admin
=>
true
)
# Remove old fields
remove_column
:users_projects
,
:read
remove_column
:users_projects
,
:write
remove_column
:users_projects
,
:admin
end
def
down
end
end
db/migrate/20111207211728_add_default_branch_to_project.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddDefaultBranchToProject
<
ActiveRecord
::
Migration
def
change
add_column
:projects
,
:default_branch
,
:string
,
:null
=>
false
,
:default
=>
"master"
end
end
db/migrate/20111214091851_create_web_hooks.rb
deleted
100644 → 0
View file @
32b9ec50
class
CreateWebHooks
<
ActiveRecord
::
Migration
def
change
create_table
:web_hooks
do
|
t
|
t
.
string
:url
t
.
integer
:project_id
t
.
timestamps
end
end
end
db/migrate/20111220190817_add_coloscheme_option_to_user.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddColoschemeOptionToUser
<
ActiveRecord
::
Migration
def
change
add_column
:users
,
:dark_scheme
,
:boolean
,
:default
=>
false
,
:null
=>
false
end
end
db/migrate/20111231111825_add_project_id_to_key.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddProjectIdToKey
<
ActiveRecord
::
Migration
def
change
add_column
:keys
,
:project_id
,
:integer
,
:null
=>
true
change_column
:keys
,
:user_id
,
:integer
,
:null
=>
true
end
end
db/migrate/20120110180749_add_line_number_to_note.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddLineNumberToNote
<
ActiveRecord
::
Migration
def
change
add_column
:notes
,
:line_code
,
:string
,
:null
=>
true
end
end
db/migrate/20120119202326_add_indexes.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddIndexes
<
ActiveRecord
::
Migration
def
change
add_index
:issues
,
:project_id
add_index
:merge_requests
,
:project_id
add_index
:notes
,
:noteable_id
add_index
:notes
,
:noteable_type
end
end
db/migrate/20120121122616_fix_noteable_id.rb
deleted
100644 → 0
View file @
32b9ec50
class
FixNoteableId
<
ActiveRecord
::
Migration
def
up
change_column
:notes
,
:noteable_id
,
:string
,
:limit
=>
255
end
def
down
end
end
db/migrate/20120206170141_add_modularity_fields_to_project.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddModularityFieldsToProject
<
ActiveRecord
::
Migration
def
change
add_column
:projects
,
:issues_enabled
,
:boolean
,
:null
=>
false
,
:default
=>
true
add_column
:projects
,
:wall_enabled
,
:boolean
,
:null
=>
false
,
:default
=>
true
add_column
:projects
,
:merge_requests_enabled
,
:boolean
,
:null
=>
false
,
:default
=>
true
end
end
db/migrate/20120215182305_create_protected_branches.rb
deleted
100644 → 0
View file @
32b9ec50
class
CreateProtectedBranches
<
ActiveRecord
::
Migration
def
change
create_table
:protected_branches
do
|
t
|
t
.
integer
:project_id
,
:null
=>
false
t
.
string
:name
,
:null
=>
false
t
.
timestamps
end
end
end
db/migrate/20120216085842_move_to_roles_permissions.rb
deleted
100644 → 0
View file @
32b9ec50
class
MoveToRolesPermissions
<
ActiveRecord
::
Migration
def
up
repo_n
=
0
repo_r
=
1
repo_rw
=
2
project_rwa
=
3
# Build masters and reset repo_access
UsersProject
.
update_all
({
:project_access
=>
UsersProject
::
MASTER
,
:repo_access
=>
99
},
[
"project_access = ?"
,
project_rwa
])
# Build other roles based on repo access
UsersProject
.
update_all
[
"project_access = ?"
,
UsersProject
::
DEVELOPER
],
[
"repo_access = ?"
,
repo_rw
]
UsersProject
.
update_all
[
"project_access = ?"
,
UsersProject
::
REPORTER
],
[
"repo_access = ?"
,
repo_r
]
UsersProject
.
update_all
[
"project_access = ?"
,
UsersProject
::
GUEST
],
[
"repo_access = ?"
,
repo_n
]
remove_column
:users_projects
,
:repo_access
end
def
down
end
end
db/migrate/20120216215008_create_wikis.rb
deleted
100644 → 0
View file @
32b9ec50
class
CreateWikis
<
ActiveRecord
::
Migration
def
change
create_table
:wikis
do
|
t
|
t
.
string
:title
t
.
text
:content
t
.
integer
:project_id
t
.
timestamps
end
end
end
db/migrate/20120219130957_add_slug_to_wiki.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddSlugToWiki
<
ActiveRecord
::
Migration
def
change
add_column
:wikis
,
:slug
,
:string
end
end
db/migrate/20120219140810_add_wiki_enabled_to_project.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddWikiEnabledToProject
<
ActiveRecord
::
Migration
def
change
add_column
:projects
,
:wiki_enabled
,
:boolean
,
:default
=>
true
,
:null
=>
false
end
end
db/migrate/20120219193300_add_user_to_wiki.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddUserToWiki
<
ActiveRecord
::
Migration
def
change
add_column
:wikis
,
:user_id
,
:integer
end
end
db/migrate/20120228130210_create_events.rb
deleted
100644 → 0
View file @
32b9ec50
class
CreateEvents
<
ActiveRecord
::
Migration
def
change
create_table
:events
do
|
t
|
t
.
string
:target_type
,
:null
=>
true
t
.
integer
:target_id
,
:null
=>
true
t
.
string
:title
,
:null
=>
true
t
.
text
:data
,
:null
=>
true
t
.
integer
:project_id
,
:null
=>
true
t
.
timestamps
end
end
end
db/migrate/20120228134252_add_action_to_event.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddActionToEvent
<
ActiveRecord
::
Migration
def
change
add_column
:events
,
:action
,
:integer
,
:null
=>
true
end
end
db/migrate/20120301185805_add_theme_to_user.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddThemeToUser
<
ActiveRecord
::
Migration
def
change
add_column
:users
,
:theme_id
,
:integer
,
:null
=>
false
,
:default
=>
1
end
end
db/migrate/20120307095918_add_author_id_to_event.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddAuthorIdToEvent
<
ActiveRecord
::
Migration
def
change
add_column
:events
,
:author_id
,
:integer
,
:null
=>
true
end
end
db/migrate/20120315111711_add_commits_diff_store_to_merge_request.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddCommitsDiffStoreToMergeRequest
<
ActiveRecord
::
Migration
def
change
add_column
:merge_requests
,
:st_commits
,
:text
,
:null
=>
true
add_column
:merge_requests
,
:st_diffs
,
:text
,
:null
=>
true
end
end
db/migrate/20120315132931_add_merged_to_merge_request.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddMergedToMergeRequest
<
ActiveRecord
::
Migration
def
change
add_column
:merge_requests
,
:merged
,
:boolean
,
:null
=>
false
,
:default
=>
false
end
end
db/migrate/20120317095543_add_description_to_issues.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddDescriptionToIssues
<
ActiveRecord
::
Migration
def
change
add_column
:issues
,
:description
,
:text
end
end
db/migrate/20120323221339_add_bio_field_to_user.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddBioFieldToUser
<
ActiveRecord
::
Migration
def
change
add_column
:users
,
:bio
,
:string
,
:null
=>
true
end
end
db/migrate/20120329170745_add_automerge_to_merge_request.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddAutomergeToMergeRequest
<
ActiveRecord
::
Migration
def
change
add_column
:merge_requests
,
:state
,
:integer
,
:null
=>
false
,
:default
=>
1
end
end
db/migrate/20120405211750_increase_mr_text_column_size.rb
deleted
100644 → 0
View file @
32b9ec50
class
IncreaseMrTextColumnSize
<
ActiveRecord
::
Migration
def
up
# MYSQL LARGETEXT for merge request
change_column
:merge_requests
,
:st_diffs
,
:text
,
:limit
=>
4294967295
change_column
:merge_requests
,
:st_commits
,
:text
,
:limit
=>
4294967295
end
def
down
end
end
db/migrate/20120408180246_create_milestones.rb
deleted
100644 → 0
View file @
32b9ec50
class
CreateMilestones
<
ActiveRecord
::
Migration
def
change
create_table
:milestones
do
|
t
|
t
.
string
:title
,
:null
=>
false
t
.
integer
:project_id
,
:null
=>
false
t
.
text
:description
t
.
date
:due_date
t
.
boolean
:closed
,
:default
=>
false
,
:null
=>
false
t
.
timestamps
end
end
end
db/migrate/20120408181910_add_milestone_id_to_issue.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddMilestoneIdToIssue
<
ActiveRecord
::
Migration
def
change
add_column
:issues
,
:milestone_id
,
:integer
,
:null
=>
true
end
end
db/migrate/20120413135904_add_blocked_field_to_user.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddBlockedFieldToUser
<
ActiveRecord
::
Migration
def
change
add_column
:users
,
:blocked
,
:boolean
,
:null
=>
false
,
:default
=>
false
end
end
db/migrate/20120627145613_remove_critical_from_issue.rb
deleted
100644 → 0
View file @
32b9ec50
class
RemoveCriticalFromIssue
<
ActiveRecord
::
Migration
def
up
remove_column
:issues
,
:critical
end
def
down
add_column
:issues
,
:critical
,
:boolean
,
:null
=>
true
,
:default
=>
false
end
end
db/migrate/20120706065612_add_lockable_to_users.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddLockableToUsers
<
ActiveRecord
::
Migration
def
change
add_column
:users
,
:failed_attempts
,
:integer
,
:default
=>
0
add_column
:users
,
:locked_at
,
:datetime
end
end
db/migrate/20120712080407_add_type_to_web_hook.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddTypeToWebHook
<
ActiveRecord
::
Migration
def
change
add_column
:web_hooks
,
:type
,
:string
,
:default
=>
"ProjectHook"
end
end
db/migrate/20120729131232_add_extern_auth_provider_to_users.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddExternAuthProviderToUsers
<
ActiveRecord
::
Migration
def
change
add_column
:users
,
:extern_uid
,
:string
add_column
:users
,
:provider
,
:string
add_index
:users
,
[
:extern_uid
,
:provider
],
:unique
=>
true
end
end
db/migrate/20120905043334_set_default_branch_default_to_nil.rb
deleted
100644 → 0
View file @
32b9ec50
class
SetDefaultBranchDefaultToNil
<
ActiveRecord
::
Migration
def
up
# Set the default_branch to allow nil, and default it to nil
change_column_null
(
:projects
,
:default_branch
,
true
)
change_column_default
(
:projects
,
:default_branch
,
nil
)
end
def
down
change_column_null
(
:projects
,
:default_branch
,
false
)
change_column_default
(
:projects
,
:default_branch
,
'master'
)
end
end
db/migrate/20121002150926_create_groups.rb
deleted
100644 → 0
View file @
32b9ec50
class
CreateGroups
<
ActiveRecord
::
Migration
def
change
create_table
:groups
do
|
t
|
t
.
string
:name
,
null:
false
t
.
string
:code
,
null:
false
t
.
integer
:owner_id
,
null:
false
t
.
timestamps
end
end
end
db/migrate/20121002151033_add_group_id_to_project.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddGroupIdToProject
<
ActiveRecord
::
Migration
def
change
add_column
:projects
,
:group_id
,
:integer
end
end
db/migrate/20121009205010_postgres_create_integer_cast.rb
deleted
100644 → 0
View file @
32b9ec50
class
PostgresCreateIntegerCast
<
ActiveRecord
::
Migration
def
up
execute
<<-
SQL
CREATE CAST (integer AS text) WITH INOUT AS IMPLICIT;
SQL
rescue
ActiveRecord
::
StatementInvalid
end
def
down
execute
<<-
SQL
DROP CAST (integer AS text);
SQL
rescue
ActiveRecord
::
StatementInvalid
end
end
db/migrate/20121026114600_add_milestone_id_to_merge_requests.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddMilestoneIdToMergeRequests
<
ActiveRecord
::
Migration
def
change
add_column
:merge_requests
,
:milestone_id
,
:integer
,
:null
=>
true
end
end
db/migrate/20121119170638_create_services.rb
deleted
100644 → 0
View file @
32b9ec50
class
CreateServices
<
ActiveRecord
::
Migration
def
change
create_table
:services
do
|
t
|
t
.
string
:type
t
.
string
:title
t
.
string
:token
t
.
integer
:project_id
,
null:
false
t
.
timestamps
end
end
end
db/migrate/20121120051432_add_service_id_to_web_hook.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddServiceIdToWebHook
<
ActiveRecord
::
Migration
def
change
add_column
:web_hooks
,
:service_id
,
:integer
,
null:
true
end
end
db/migrate/20121120103700_add_active_to_service.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddActiveToService
<
ActiveRecord
::
Migration
def
change
add_column
:services
,
:active
,
:boolean
,
default:
false
,
null:
false
end
end
db/migrate/20121120113838_add_project_url_to_service.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddProjectUrlToService
<
ActiveRecord
::
Migration
def
change
add_column
:services
,
:project_url
,
:string
,
null:
true
end
end
db/migrate/20121122145155_convert_group_to_namespace.rb
deleted
100644 → 0
View file @
32b9ec50
class
ConvertGroupToNamespace
<
ActiveRecord
::
Migration
def
up
rename_table
'groups'
,
'namespaces'
add_column
:namespaces
,
:type
,
:string
,
null:
true
# Migrate old groups
Namespace
.
update_all
(
type:
'Group'
)
end
def
down
raise
'Rollback is not allowed'
end
end
db/migrate/20121122150932_add_namespace_id_to_project.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddNamespaceIdToProject
<
ActiveRecord
::
Migration
def
change
rename_column
:projects
,
:group_id
,
:namespace_id
end
end
db/migrate/20121123104937_add_username_to_user.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddUsernameToUser
<
ActiveRecord
::
Migration
def
change
add_column
:users
,
:username
,
:string
,
null:
true
end
end
db/migrate/20121123164910_rename_code_to_path.rb
deleted
100644 → 0
View file @
32b9ec50
class
RenameCodeToPath
<
ActiveRecord
::
Migration
def
up
remove_column
:projects
,
:code
rename_column
:namespaces
,
:code
,
:path
end
def
down
add_column
:projects
,
:code
,
:string
rename_column
:namespaces
,
:path
,
:code
end
end
db/migrate/20121203154450_add_events_indices.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddEventsIndices
<
ActiveRecord
::
Migration
def
change
add_index
:events
,
:project_id
add_index
:events
,
:author_id
add_index
:events
,
:action
add_index
:events
,
:target_type
end
end
db/migrate/20121203160507_more_indices.rb
deleted
100644 → 0
View file @
32b9ec50
class
MoreIndices
<
ActiveRecord
::
Migration
def
change
add_index
:notes
,
:project_id
add_index
:namespaces
,
:owner_id
add_index
:keys
,
:user_id
add_index
:projects
,
:namespace_id
add_index
:projects
,
:owner_id
add_index
:services
,
:project_id
add_index
:snippets
,
:project_id
add_index
:users_projects
,
:project_id
# Issues
add_index
:issues
,
:assignee_id
add_index
:issues
,
:milestone_id
add_index
:issues
,
:author_id
# Merge Requests
add_index
:merge_requests
,
:assignee_id
add_index
:merge_requests
,
:milestone_id
add_index
:merge_requests
,
:author_id
end
end
db/migrate/20121205201726_add_more_indexes.rb
deleted
100644 → 0
View file @
32b9ec50
class
AddMoreIndexes
<
ActiveRecord
::
Migration
def
change
add_index
:events
,
:created_at
add_index
:events
,
:target_id
add_index
:issues
,
:closed
add_index
:issues
,
:created_at
add_index
:issues
,
:title
add_index
:keys
,
:identifier
# FIXME: MySQL can't index text columns
#add_index :keys, :key
add_index
:keys
,
:project_id
add_index
:merge_requests
,
:closed
add_index
:merge_requests
,
:created_at
add_index
:merge_requests
,
:source_branch
add_index
:merge_requests
,
:target_branch
add_index
:merge_requests
,
:title
add_index
:milestones
,
:due_date
add_index
:milestones
,
:project_id
add_index
:namespaces
,
:name
add_index
:namespaces
,
:path
add_index
:namespaces
,
:type
add_index
:notes
,
:created_at
add_index
:snippets
,
:created_at
add_index
:snippets
,
:expires_at
add_index
:users
,
:admin
add_index
:users
,
:blocked
add_index
:users
,
:name
add_index
:users
,
:username
add_index
:users_projects
,
:project_access
add_index
:users_projects
,
:user_id
add_index
:wikis
,
:project_id
add_index
:wikis
,
:slug
end
end
db/migrate/20121218164840_move_noteable_commit_to_own_field.rb
deleted
100644 → 0
View file @
32b9ec50
class
MoveNoteableCommitToOwnField
<
ActiveRecord
::
Migration
def
up
add_column
:notes
,
:commit_id
,
:string
,
null:
true
add_column
:notes
,
:new_noteable_id
,
:integer
,
null:
true
Note
.
where
(
noteable_type:
'Commit'
).
update_all
(
'commit_id = noteable_id'
)
if
ActiveRecord
::
Base
.
connection
.
adapter_name
==
'PostgreSQL'
Note
.
where
(
"noteable_type != 'Commit'"
).
update_all
(
'new_noteable_id = CAST (noteable_id AS INTEGER)'
)
else
Note
.
where
(
"noteable_type != 'Commit'"
).
update_all
(
'new_noteable_id = noteable_id'
)
end
remove_column
:notes
,
:noteable_id
rename_column
:notes
,
:new_noteable_id
,
:noteable_id
end
def
down
raise
ActiveRecord
::
IrreversibleMigration
end
end
db/migrate/20121219095402_indices_for_notes.rb
deleted
100644 → 0
View file @
32b9ec50
class
IndicesForNotes
<
ActiveRecord
::
Migration
def
change
add_index
:notes
,
:commit_id
add_index
:notes
,
[
:project_id
,
:noteable_type
]
end
end
db/migrate/20121219183753_create_user_teams.rb
deleted
100644 → 0
View file @
32b9ec50
class
CreateUserTeams
<
ActiveRecord
::
Migration
def
change
create_table
:user_teams
do
|
t
|
t
.
string
:name
t
.
string
:path
t
.
integer
:owner_id
t
.
timestamps
end
end
end
db/migrate/20121220064104_create_user_team_project_relationships.rb
deleted
100644 → 0
View file @
32b9ec50
class
CreateUserTeamProjectRelationships
<
ActiveRecord
::
Migration
def
change
create_table
:user_team_project_relationships
do
|
t
|
t
.
integer
:project_id
t
.
integer
:user_team_id
t
.
integer
:greatest_access
t
.
timestamps
end
end
end
db/migrate/20121220064453_create_user_team_user_relationships.rb
deleted
100644 → 0
View file @
32b9ec50
class
CreateUserTeamUserRelationships
<
ActiveRecord
::
Migration
def
change
create_table
:user_team_user_relationships
do
|
t
|
t
.
integer
:user_id
t
.
integer
:user_team_id
t
.
boolean
:group_admin
t
.
integer
:permission
t
.
timestamps
end
end
end
db/migrate/20121220064453_init_schema.rb
0 → 100644
View file @
e8f8abdd
class
InitSchema
<
ActiveRecord
::
Migration
def
up
create_table
"events"
,
force:
true
do
|
t
|
t
.
string
"target_type"
t
.
integer
"target_id"
t
.
string
"title"
t
.
text
"data"
t
.
integer
"project_id"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
integer
"action"
t
.
integer
"author_id"
end
add_index
"events"
,
[
"action"
],
name:
"index_events_on_action"
,
using: :btree
add_index
"events"
,
[
"author_id"
],
name:
"index_events_on_author_id"
,
using: :btree
add_index
"events"
,
[
"created_at"
],
name:
"index_events_on_created_at"
,
using: :btree
add_index
"events"
,
[
"project_id"
],
name:
"index_events_on_project_id"
,
using: :btree
add_index
"events"
,
[
"target_id"
],
name:
"index_events_on_target_id"
,
using: :btree
add_index
"events"
,
[
"target_type"
],
name:
"index_events_on_target_type"
,
using: :btree
create_table
"issues"
,
force:
true
do
|
t
|
t
.
string
"title"
t
.
integer
"assignee_id"
t
.
integer
"author_id"
t
.
integer
"project_id"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
boolean
"closed"
,
default:
false
,
null:
false
t
.
integer
"position"
,
default:
0
t
.
string
"branch_name"
t
.
text
"description"
t
.
integer
"milestone_id"
end
add_index
"issues"
,
[
"assignee_id"
],
name:
"index_issues_on_assignee_id"
,
using: :btree
add_index
"issues"
,
[
"author_id"
],
name:
"index_issues_on_author_id"
,
using: :btree
add_index
"issues"
,
[
"closed"
],
name:
"index_issues_on_closed"
,
using: :btree
add_index
"issues"
,
[
"created_at"
],
name:
"index_issues_on_created_at"
,
using: :btree
add_index
"issues"
,
[
"milestone_id"
],
name:
"index_issues_on_milestone_id"
,
using: :btree
add_index
"issues"
,
[
"project_id"
],
name:
"index_issues_on_project_id"
,
using: :btree
add_index
"issues"
,
[
"title"
],
name:
"index_issues_on_title"
,
using: :btree
create_table
"keys"
,
force:
true
do
|
t
|
t
.
integer
"user_id"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
text
"key"
t
.
string
"title"
t
.
string
"identifier"
t
.
integer
"project_id"
end
add_index
"keys"
,
[
"identifier"
],
name:
"index_keys_on_identifier"
,
using: :btree
add_index
"keys"
,
[
"project_id"
],
name:
"index_keys_on_project_id"
,
using: :btree
add_index
"keys"
,
[
"user_id"
],
name:
"index_keys_on_user_id"
,
using: :btree
create_table
"merge_requests"
,
force:
true
do
|
t
|
t
.
string
"target_branch"
,
null:
false
t
.
string
"source_branch"
,
null:
false
t
.
integer
"project_id"
,
null:
false
t
.
integer
"author_id"
t
.
integer
"assignee_id"
t
.
string
"title"
t
.
boolean
"closed"
,
default:
false
,
null:
false
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
text
"st_commits"
,
limit:
2147483647
t
.
text
"st_diffs"
,
limit:
2147483647
t
.
boolean
"merged"
,
default:
false
,
null:
false
t
.
integer
"state"
,
default:
1
,
null:
false
t
.
integer
"milestone_id"
end
add_index
"merge_requests"
,
[
"assignee_id"
],
name:
"index_merge_requests_on_assignee_id"
,
using: :btree
add_index
"merge_requests"
,
[
"author_id"
],
name:
"index_merge_requests_on_author_id"
,
using: :btree
add_index
"merge_requests"
,
[
"closed"
],
name:
"index_merge_requests_on_closed"
,
using: :btree
add_index
"merge_requests"
,
[
"created_at"
],
name:
"index_merge_requests_on_created_at"
,
using: :btree
add_index
"merge_requests"
,
[
"milestone_id"
],
name:
"index_merge_requests_on_milestone_id"
,
using: :btree
add_index
"merge_requests"
,
[
"project_id"
],
name:
"index_merge_requests_on_project_id"
,
using: :btree
add_index
"merge_requests"
,
[
"source_branch"
],
name:
"index_merge_requests_on_source_branch"
,
using: :btree
add_index
"merge_requests"
,
[
"target_branch"
],
name:
"index_merge_requests_on_target_branch"
,
using: :btree
add_index
"merge_requests"
,
[
"title"
],
name:
"index_merge_requests_on_title"
,
using: :btree
create_table
"milestones"
,
force:
true
do
|
t
|
t
.
string
"title"
,
null:
false
t
.
integer
"project_id"
,
null:
false
t
.
text
"description"
t
.
date
"due_date"
t
.
boolean
"closed"
,
default:
false
,
null:
false
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
end
add_index
"milestones"
,
[
"due_date"
],
name:
"index_milestones_on_due_date"
,
using: :btree
add_index
"milestones"
,
[
"project_id"
],
name:
"index_milestones_on_project_id"
,
using: :btree
create_table
"namespaces"
,
force:
true
do
|
t
|
t
.
string
"name"
,
null:
false
t
.
string
"path"
,
null:
false
t
.
integer
"owner_id"
,
null:
false
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
string
"type"
end
add_index
"namespaces"
,
[
"name"
],
name:
"index_namespaces_on_name"
,
using: :btree
add_index
"namespaces"
,
[
"owner_id"
],
name:
"index_namespaces_on_owner_id"
,
using: :btree
add_index
"namespaces"
,
[
"path"
],
name:
"index_namespaces_on_path"
,
using: :btree
add_index
"namespaces"
,
[
"type"
],
name:
"index_namespaces_on_type"
,
using: :btree
create_table
"notes"
,
force:
true
do
|
t
|
t
.
text
"note"
t
.
string
"noteable_type"
t
.
integer
"author_id"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
integer
"project_id"
t
.
string
"attachment"
t
.
string
"line_code"
t
.
string
"commit_id"
t
.
integer
"noteable_id"
end
add_index
"notes"
,
[
"commit_id"
],
name:
"index_notes_on_commit_id"
,
using: :btree
add_index
"notes"
,
[
"created_at"
],
name:
"index_notes_on_created_at"
,
using: :btree
add_index
"notes"
,
[
"noteable_type"
],
name:
"index_notes_on_noteable_type"
,
using: :btree
add_index
"notes"
,
[
"project_id"
,
"noteable_type"
],
name:
"index_notes_on_project_id_and_noteable_type"
,
using: :btree
add_index
"notes"
,
[
"project_id"
],
name:
"index_notes_on_project_id"
,
using: :btree
create_table
"projects"
,
force:
true
do
|
t
|
t
.
string
"name"
t
.
string
"path"
t
.
text
"description"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
boolean
"private_flag"
,
default:
true
,
null:
false
t
.
integer
"owner_id"
t
.
string
"default_branch"
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
t
.
integer
"namespace_id"
end
add_index
"projects"
,
[
"namespace_id"
],
name:
"index_projects_on_namespace_id"
,
using: :btree
add_index
"projects"
,
[
"owner_id"
],
name:
"index_projects_on_owner_id"
,
using: :btree
create_table
"protected_branches"
,
force:
true
do
|
t
|
t
.
integer
"project_id"
,
null:
false
t
.
string
"name"
,
null:
false
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
end
create_table
"services"
,
force:
true
do
|
t
|
t
.
string
"type"
t
.
string
"title"
t
.
string
"token"
t
.
integer
"project_id"
,
null:
false
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
boolean
"active"
,
default:
false
,
null:
false
t
.
string
"project_url"
end
add_index
"services"
,
[
"project_id"
],
name:
"index_services_on_project_id"
,
using: :btree
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
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
string
"file_name"
t
.
datetime
"expires_at"
end
add_index
"snippets"
,
[
"created_at"
],
name:
"index_snippets_on_created_at"
,
using: :btree
add_index
"snippets"
,
[
"expires_at"
],
name:
"index_snippets_on_expires_at"
,
using: :btree
add_index
"snippets"
,
[
"project_id"
],
name:
"index_snippets_on_project_id"
,
using: :btree
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"
,
using: :btree
add_index
"taggings"
,
[
"taggable_id"
,
"taggable_type"
,
"context"
],
name:
"index_taggings_on_taggable_id_and_taggable_type_and_context"
,
using: :btree
create_table
"tags"
,
force:
true
do
|
t
|
t
.
string
"name"
end
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"
t
.
datetime
"updated_at"
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"
t
.
datetime
"updated_at"
end
create_table
"user_teams"
,
force:
true
do
|
t
|
t
.
string
"name"
t
.
string
"path"
t
.
integer
"owner_id"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
end
create_table
"users"
,
force:
true
do
|
t
|
t
.
string
"email"
,
default:
""
,
null:
false
t
.
string
"encrypted_password"
,
default:
""
,
null:
false
t
.
string
"reset_password_token"
t
.
datetime
"reset_password_sent_at"
t
.
datetime
"remember_created_at"
t
.
integer
"sign_in_count"
,
default:
0
t
.
datetime
"current_sign_in_at"
t
.
datetime
"last_sign_in_at"
t
.
string
"current_sign_in_ip"
t
.
string
"last_sign_in_ip"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
string
"name"
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
t
.
string
"authentication_token"
t
.
boolean
"dark_scheme"
,
default:
false
,
null:
false
t
.
integer
"theme_id"
,
default:
1
,
null:
false
t
.
string
"bio"
t
.
boolean
"blocked"
,
default:
false
,
null:
false
t
.
integer
"failed_attempts"
,
default:
0
t
.
datetime
"locked_at"
t
.
string
"extern_uid"
t
.
string
"provider"
t
.
string
"username"
end
add_index
"users"
,
[
"admin"
],
name:
"index_users_on_admin"
,
using: :btree
add_index
"users"
,
[
"blocked"
],
name:
"index_users_on_blocked"
,
using: :btree
add_index
"users"
,
[
"email"
],
name:
"index_users_on_email"
,
unique:
true
,
using: :btree
add_index
"users"
,
[
"extern_uid"
,
"provider"
],
name:
"index_users_on_extern_uid_and_provider"
,
unique:
true
,
using: :btree
add_index
"users"
,
[
"name"
],
name:
"index_users_on_name"
,
using: :btree
add_index
"users"
,
[
"reset_password_token"
],
name:
"index_users_on_reset_password_token"
,
unique:
true
,
using: :btree
add_index
"users"
,
[
"username"
],
name:
"index_users_on_username"
,
using: :btree
create_table
"users_projects"
,
force:
true
do
|
t
|
t
.
integer
"user_id"
,
null:
false
t
.
integer
"project_id"
,
null:
false
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
integer
"project_access"
,
default:
0
,
null:
false
end
add_index
"users_projects"
,
[
"project_access"
],
name:
"index_users_projects_on_project_access"
,
using: :btree
add_index
"users_projects"
,
[
"project_id"
],
name:
"index_users_projects_on_project_id"
,
using: :btree
add_index
"users_projects"
,
[
"user_id"
],
name:
"index_users_projects_on_user_id"
,
using: :btree
create_table
"web_hooks"
,
force:
true
do
|
t
|
t
.
string
"url"
t
.
integer
"project_id"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
string
"type"
,
default:
"ProjectHook"
t
.
integer
"service_id"
end
create_table
"wikis"
,
force:
true
do
|
t
|
t
.
string
"title"
t
.
text
"content"
t
.
integer
"project_id"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
string
"slug"
t
.
integer
"user_id"
end
add_index
"wikis"
,
[
"project_id"
],
name:
"index_wikis_on_project_id"
,
using: :btree
add_index
"wikis"
,
[
"slug"
],
name:
"index_wikis_on_slug"
,
using: :btree
end
def
down
raise
"Can not revert initial migration"
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment