mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 23:30:12 +01:00
Add Rails version to the migrations.
This commit is contained in:
parent
820f5b5f8f
commit
6fb6cac89c
65 changed files with 68 additions and 68 deletions
|
|
@ -1,5 +1,5 @@
|
|||
# Verision 1.0.3 database
|
||||
class CreateTracksDb < ActiveRecord::Migration
|
||||
class CreateTracksDb < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
create_table :contexts do |t|
|
||||
t.column :name, :string, :null => false
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddUserId < ActiveRecord::Migration
|
||||
class AddUserId < ActiveRecord::Migration[5.2]
|
||||
|
||||
class Project < ActiveRecord::Base; end
|
||||
class Context < ActiveRecord::Base; end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class CreatedAt < ActiveRecord::Migration
|
||||
class CreatedAt < ActiveRecord::Migration[5.2]
|
||||
# Current bug in Rails that prevents rename_column working in SQLite
|
||||
# if the column names use symbols instead of strings.
|
||||
# <http://dev.rubyonrails.org/changeset/2731>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class Notes < ActiveRecord::Migration
|
||||
class Notes < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
create_table :notes do |t|
|
||||
t.column :user_id, :integer, :null => false
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddProjectDescription < ActiveRecord::Migration
|
||||
class AddProjectDescription < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
add_column :projects, :description, :text
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddPreferencesToUserTable < ActiveRecord::Migration
|
||||
class AddPreferencesToUserTable < ActiveRecord::Migration[5.2]
|
||||
|
||||
class User < ActiveRecord::Base; end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddSessionsTable < ActiveRecord::Migration
|
||||
class AddSessionsTable < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
create_table :sessions do |t|
|
||||
t.column :session_id, :string
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddSubclassAttrToTodos < ActiveRecord::Migration
|
||||
class AddSubclassAttrToTodos < ActiveRecord::Migration[5.2]
|
||||
|
||||
class Todo < ActiveRecord::Base; end
|
||||
class Immediate < Todo; end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddUserPrefRefresh < ActiveRecord::Migration
|
||||
class AddUserPrefRefresh < ActiveRecord::Migration[5.2]
|
||||
|
||||
class User < ActiveRecord::Base; serialize :preferences; end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddFirstAndLastNameToUser < ActiveRecord::Migration
|
||||
class AddFirstAndLastNameToUser < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
add_column :users, :first_name, :string
|
||||
add_column :users, :last_name, :string
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class PrefToShowHideSidebarItems < ActiveRecord::Migration
|
||||
class PrefToShowHideSidebarItems < ActiveRecord::Migration[5.2]
|
||||
|
||||
class User < ActiveRecord::Base; serialize :preferences; end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddPreferencesModel < ActiveRecord::Migration
|
||||
class AddPreferencesModel < ActiveRecord::Migration[5.2]
|
||||
|
||||
class User < ActiveRecord::Base; serialize :preferences; end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class ConvertPreferences < ActiveRecord::Migration
|
||||
class ConvertPreferences < ActiveRecord::Migration[5.2]
|
||||
|
||||
class User < ActiveRecord::Base; has_one :preference; serialize :preferences; end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class ConvertProjectToStateMachine < ActiveRecord::Migration
|
||||
class ConvertProjectToStateMachine < ActiveRecord::Migration[5.2]
|
||||
|
||||
class Project < ActiveRecord::Base; end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddVerboseActionDescriptorsPreference < ActiveRecord::Migration
|
||||
class AddVerboseActionDescriptorsPreference < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
add_column :preferences, :verbose_action_descriptors, :boolean, :default => false, :null => false
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddUserAuthType < ActiveRecord::Migration
|
||||
class AddUserAuthType < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
add_column :users, :auth_type, :string, :default => 'database', :null => false
|
||||
end
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
class AddOpenIdTables < ActiveRecord::Migration
|
||||
class AddOpenIdTables < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
create_table "open_id_associations", :force => true do |t|
|
||||
t.column "server_url", :binary
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddUserOpenIdUrl < ActiveRecord::Migration
|
||||
class AddUserOpenIdUrl < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
add_column :users, :open_id_url, :string
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class ConvertTodoToStateMachine < ActiveRecord::Migration
|
||||
class ConvertTodoToStateMachine < ActiveRecord::Migration[5.2]
|
||||
|
||||
class Todo < ActiveRecord::Base; belongs_to :project; end
|
||||
class Immediate < Todo; end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class PrefToShowHiddenProjectsInSidebar < ActiveRecord::Migration
|
||||
class PrefToShowHiddenProjectsInSidebar < ActiveRecord::Migration[5.2]
|
||||
|
||||
def self.up
|
||||
add_column :preferences, :show_hidden_projects_in_sidebar, :boolean, :default => true, :null => false
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddTimeZonePreference < ActiveRecord::Migration
|
||||
class AddTimeZonePreference < ActiveRecord::Migration[5.2]
|
||||
|
||||
def self.up
|
||||
add_column :preferences, :time_zone, :string, :limit => 255, :default => 'London', :null => false
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddIndices < ActiveRecord::Migration
|
||||
class AddIndices < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
add_index :todos, [:user_id, :state]
|
||||
add_index :todos, [:user_id, :project_id]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class IndexOnUserLogin < ActiveRecord::Migration
|
||||
class IndexOnUserLogin < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
add_index :users, :login
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddFindByNameIndices < ActiveRecord::Migration
|
||||
class AddFindByNameIndices < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
add_index :projects, [:user_id, :name]
|
||||
add_index :contexts, [:user_id, :name]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddTagSupport < ActiveRecord::Migration
|
||||
class AddTagSupport < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
create_table :taggings do |t|
|
||||
t.column :taggable_id, :integer
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddProjectTimestamps < ActiveRecord::Migration
|
||||
class AddProjectTimestamps < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
add_column :projects, :created_at, :timestamp
|
||||
add_column :projects, :updated_at, :timestamp
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddContextTimestamps < ActiveRecord::Migration
|
||||
class AddContextTimestamps < ActiveRecord::Migration[5.2]
|
||||
|
||||
def self.up
|
||||
add_column :contexts, :created_at, :timestamp
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddShowProjectOnTodoDonePreference < ActiveRecord::Migration
|
||||
class AddShowProjectOnTodoDonePreference < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
add_column :preferences, :show_project_on_todo_done, :boolean, :default => false, :null => false
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddTitleDateFormatPreference < ActiveRecord::Migration
|
||||
class AddTitleDateFormatPreference < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
add_column :preferences, :title_date_format, :string, :limit => 255, :default => '%A, %d %B %Y', :null => false
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class SetNilTimestamps < ActiveRecord::Migration
|
||||
class SetNilTimestamps < ActiveRecord::Migration[5.2]
|
||||
|
||||
class Project < ActiveRecord::Base; end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddDefaultContextToProject < ActiveRecord::Migration
|
||||
class AddDefaultContextToProject < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
add_column :projects, :default_context_id, :integer
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddMobileTodosPerPagePreference < ActiveRecord::Migration
|
||||
class AddMobileTodosPerPagePreference < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
add_column :preferences, :mobile_todos_per_page, :integer, :null => false, :default => 6
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddRememberMeToUser < ActiveRecord::Migration
|
||||
class AddRememberMeToUser < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
rename_column :users, 'password', 'crypted_password' #bug in sqlite requires column names as strings
|
||||
add_column :users, :remember_token, :string
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class RenameWordToToken < ActiveRecord::Migration
|
||||
class RenameWordToToken < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
rename_column :users, 'word', 'token' #bug in sqlite requires column names as strings
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class UpdateOpenIdUrls < ActiveRecord::Migration
|
||||
class UpdateOpenIdUrls < ActiveRecord::Migration[5.2]
|
||||
|
||||
class User < ActiveRecord::Base
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddProjectCompletedAtColumn < ActiveRecord::Migration
|
||||
class AddProjectCompletedAtColumn < ActiveRecord::Migration[5.2]
|
||||
|
||||
class Project < ActiveRecord::Base; end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddIndexToNotes < ActiveRecord::Migration
|
||||
class AddIndexToNotes < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
add_index :notes, [:project_id]
|
||||
add_index :notes, [:user_id]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class ProjectsContextsRemoveNotNullFromPosition < ActiveRecord::Migration
|
||||
class ProjectsContextsRemoveNotNullFromPosition < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
change_column :projects, :position, :integer, {:null => true, :default => nil}
|
||||
change_column :contexts, :position, :integer, {:null => true, :default => nil}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class CreateRecurringTodos < ActiveRecord::Migration
|
||||
class CreateRecurringTodos < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
create_table :recurring_todos do |t|
|
||||
# todo data
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddSeveralIndexes < ActiveRecord::Migration
|
||||
class AddSeveralIndexes < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
add_index :taggings, [:taggable_id, :taggable_type]
|
||||
add_index :taggings, :tag_id
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddSmsToPreference < ActiveRecord::Migration
|
||||
class AddSmsToPreference < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
add_column :preferences, :sms_email, :string
|
||||
add_column :preferences, :sms_context_id, :integer
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class ChangeDatesToDatetimes < ActiveRecord::Migration
|
||||
class ChangeDatesToDatetimes < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
change_column :todos, :show_from, :datetime
|
||||
change_column :todos, :due, :datetime
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddUpdatedAtToTodos < ActiveRecord::Migration
|
||||
class AddUpdatedAtToTodos < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
add_column :todos, :updated_at, :timestamp
|
||||
execute 'update todos set updated_at = created_at where completed_at IS NULL'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class UpgradeOpenId < ActiveRecord::Migration
|
||||
class UpgradeOpenId < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
create_table :open_id_authentication_associations, :force => true do |t|
|
||||
t.integer :issued, :lifetime
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class RemoveUserFromTaggings < ActiveRecord::Migration
|
||||
class RemoveUserFromTaggings < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
remove_index :taggings, [:tag_id, :taggable_id, :taggable_type]
|
||||
remove_index :tags, :name
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class FixIncorrectlyHiddenTodos < ActiveRecord::Migration
|
||||
class FixIncorrectlyHiddenTodos < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
hidden_todos_without_project =
|
||||
Todo.where(:state => 'project_hidden', :project_id => nil)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddDefaultTagsToProject < ActiveRecord::Migration
|
||||
class AddDefaultTagsToProject < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
add_column :projects, :default_tags, :string
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddTodoDependencies < ActiveRecord::Migration
|
||||
class AddTodoDependencies < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
create_table :dependencies do |t|
|
||||
t.integer :successor_id, :null => false
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddShowAlwaysToRecurringTodo < ActiveRecord::Migration
|
||||
class AddShowAlwaysToRecurringTodo < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
add_column :recurring_todos, :show_always, :boolean
|
||||
recurring_todos = RecurringTodo.all
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddIndexToTodoState < ActiveRecord::Migration
|
||||
class AddIndexToTodoState < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
add_index :todos, :state
|
||||
end
|
||||
|
|
@ -6,4 +6,4 @@ class AddIndexToTodoState < ActiveRecord::Migration
|
|||
def self.down
|
||||
remove_index :todos, :state
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddLocaleToPreference < ActiveRecord::Migration
|
||||
class AddLocaleToPreference < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
add_column :preferences, :locale, :string
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AdaptToNewAasm < ActiveRecord::Migration
|
||||
class AdaptToNewAasm < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
change_column_default :todos, :state, nil
|
||||
change_column_default :projects, :state, nil
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class MakeOldRecurringTodosValidate < ActiveRecord::Migration
|
||||
class MakeOldRecurringTodosValidate < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
RecurringTodo.all.each do |rt|
|
||||
# show_always may not be nil
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class ChangeCryptedPasswordLength < ActiveRecord::Migration
|
||||
class ChangeCryptedPasswordLength < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
change_column 'users', 'crypted_password', :string, :limit => 60
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddLastReviewedToProject < ActiveRecord::Migration
|
||||
class AddLastReviewedToProject < ActiveRecord::Migration[5.2]
|
||||
|
||||
def self.up
|
||||
add_column :projects, :last_reviewed, :timestamp
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddNextReviewPreferences < ActiveRecord::Migration
|
||||
class AddNextReviewPreferences < ActiveRecord::Migration[5.2]
|
||||
|
||||
def self.up
|
||||
add_column :preferences, :review_period, :integer, :default => 14, :null => false
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddIndicesToDependencyTable < ActiveRecord::Migration
|
||||
class AddIndicesToDependencyTable < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
add_index :dependencies, :successor_id
|
||||
add_index :dependencies, :predecessor_id
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddRenderedNotes < ActiveRecord::Migration
|
||||
class AddRenderedNotes < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
add_column :todos, 'rendered_notes', :text
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class CreateTolkTables < ActiveRecord::Migration
|
||||
class CreateTolkTables < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
create_table :tolk_locales do |t|
|
||||
t.string :name
|
||||
|
|
@ -35,4 +35,4 @@ class CreateTolkTables < ActiveRecord::Migration
|
|||
drop_table :tolk_phrases
|
||||
drop_table :tolk_locales
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class NoDefaultAdminEmail < ActiveRecord::Migration
|
||||
class NoDefaultAdminEmail < ActiveRecord::Migration[5.2]
|
||||
def up
|
||||
remove_column :preferences, :admin_email
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class AddStateToContext < ActiveRecord::Migration
|
||||
class AddStateToContext < ActiveRecord::Migration[5.2]
|
||||
|
||||
class Context < ActiveRecord::Base
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class RenameOccurencesToOccurrences < ActiveRecord::Migration
|
||||
class RenameOccurencesToOccurrences < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
rename_column :recurring_todos, :number_of_occurences, :number_of_occurrences
|
||||
rename_column :recurring_todos, :occurences_count, :occurrences_count
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class RemoveRenderedNotes < ActiveRecord::Migration
|
||||
class RemoveRenderedNotes < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
remove_column :todos, 'rendered_notes'
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class CreateAttachments < ActiveRecord::Migration
|
||||
class CreateAttachments < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :attachments do |t|
|
||||
t.references :todo, index: true
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class RemoveProjectHiddenStateFromTodos < ActiveRecord::Migration
|
||||
class RemoveProjectHiddenStateFromTodos < ActiveRecord::Migration[5.2]
|
||||
class Todo < ActiveRecord::Base
|
||||
has_many :successor_dependencies, :foreign_key => 'successor_id', :class_name => 'Dependency'
|
||||
belongs_to :project
|
||||
|
|
@ -39,4 +39,4 @@ class RemoveProjectHiddenStateFromTodos < ActiveRecord::Migration
|
|||
end
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue