start to switch to rails 3.2.2
This commit is contained in:
parent
244942a78f
commit
74c23fa0d1
253 changed files with 648 additions and 17155 deletions
|
@ -1,15 +0,0 @@
|
|||
class CreateUsers < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :users do |t|
|
||||
t.string :email
|
||||
t.string :first_name
|
||||
t.string :last_name
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :users
|
||||
end
|
||||
end
|
|
@ -1,14 +0,0 @@
|
|||
class CreateServers < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :servers do |t|
|
||||
t.string :name
|
||||
t.string :port
|
||||
t.references :user
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :servers
|
||||
end
|
||||
end
|
|
@ -1,14 +0,0 @@
|
|||
class CreatePrefs < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :prefs do |t|
|
||||
t.string :theme
|
||||
t.string :locale
|
||||
t.references :user
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :prefs
|
||||
end
|
||||
end
|
|
@ -1,11 +0,0 @@
|
|||
class AddParamsToPrefs < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :prefs, :msgs_per_page, :string
|
||||
add_column :prefs, :msg_send_type, :string
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :prefs, :msg_send_type
|
||||
remove_column :prefs, :msgs_per_page
|
||||
end
|
||||
end
|
|
@ -1,9 +0,0 @@
|
|||
class AddUseSslToServers < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :servers, :use_ssl, :boolean
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :servers, :use_ssl, :boolean
|
||||
end
|
||||
end
|
|
@ -1,17 +0,0 @@
|
|||
class CreateFolders < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :folders do |t|
|
||||
t.string :name
|
||||
t.string :delim
|
||||
t.string :attribs
|
||||
t.integer :messages
|
||||
t.integer :new
|
||||
t.references :user
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :folders
|
||||
end
|
||||
end
|
|
@ -1,11 +0,0 @@
|
|||
class RenameAttribsInFolders < ActiveRecord::Migration
|
||||
def self.up
|
||||
rename_column :folders,:attribs,:haschildren
|
||||
change_column :folders,:haschildren,:boolean
|
||||
end
|
||||
|
||||
def self.down
|
||||
change_column :folders,:haschildren,:string
|
||||
rename_column :folders,:haschildren,:attribs
|
||||
end
|
||||
end
|
|
@ -1,9 +0,0 @@
|
|||
class ChangeNewInFolder < ActiveRecord::Migration
|
||||
def self.up
|
||||
rename_column :folders,:new,:unseen
|
||||
end
|
||||
|
||||
def self.down
|
||||
rename_column :folders,:unseen,:new
|
||||
end
|
||||
end
|
|
@ -1,9 +0,0 @@
|
|||
class AddColumnToFolder < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :folders, :parent, :string
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :folders, :parent
|
||||
end
|
||||
end
|
|
@ -1,9 +0,0 @@
|
|||
class AddColumnMsgsToFolder < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :folders, :msgs_updated_at, :datetime
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :folders, :msgs_updated_at
|
||||
end
|
||||
end
|
|
@ -1,23 +0,0 @@
|
|||
class CreateMessages < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :messages ,:id => false do |t|
|
||||
t.integer :folder_id
|
||||
t.integer :user_id
|
||||
t.string :msg_id
|
||||
t.string :from
|
||||
t.string :to
|
||||
t.string :subject
|
||||
t.string :content_type
|
||||
t.integer :uid
|
||||
t.integer :size
|
||||
t.boolean :unread
|
||||
t.datetime :date
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :messages
|
||||
end
|
||||
end
|
|
@ -1,11 +0,0 @@
|
|||
class AddShownToFolders < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :folders, :shown, :boolean
|
||||
add_column :folders, :alter_name, :string
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :folders, :alter_name
|
||||
remove_column :folders, :shown
|
||||
end
|
||||
end
|
|
@ -1,9 +0,0 @@
|
|||
class RenameMEssagesInFolder < ActiveRecord::Migration
|
||||
def self.up
|
||||
rename_column :folders,:messages,:total
|
||||
end
|
||||
|
||||
def self.down
|
||||
rename_column :folders,:total,:messages
|
||||
end
|
||||
end
|
|
@ -1,9 +0,0 @@
|
|||
class RenameUnseenInMessage < ActiveRecord::Migration
|
||||
def self.up
|
||||
rename_column :messages, :unread, :unseen
|
||||
end
|
||||
|
||||
def self.down
|
||||
rename_column :messages, :unseen, :unread
|
||||
end
|
||||
end
|
|
@ -1,17 +0,0 @@
|
|||
class CreateContacts < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :contacts do |t|
|
||||
t.string :nick
|
||||
t.string :email
|
||||
t.string :first_name
|
||||
t.string :last_name
|
||||
t.string :info
|
||||
t.references :user
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :contacts
|
||||
end
|
||||
end
|
|
@ -1,11 +0,0 @@
|
|||
class RenameFromColumnInMessages < ActiveRecord::Migration
|
||||
def self.up
|
||||
rename_column :messages, :from, :from_addr
|
||||
rename_column :messages, :to, :to_addr
|
||||
end
|
||||
|
||||
def self.down
|
||||
rename_column :messages, :from_addr, :from
|
||||
rename_column :messages, :to_addr, :to
|
||||
end
|
||||
end
|
|
@ -1,9 +0,0 @@
|
|||
class RemoveMsgsUpdateFromMessages < ActiveRecord::Migration
|
||||
def self.up
|
||||
remove_column :folders, :msgs_updated_at
|
||||
end
|
||||
|
||||
def self.down
|
||||
add_column :folders, :msgs_updated_at, :datetime
|
||||
end
|
||||
end
|
|
@ -1,13 +0,0 @@
|
|||
class AddOptionsToServers < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :servers,:use_tls,:boolean
|
||||
add_column :servers,:for_imap,:boolean
|
||||
add_column :servers,:for_smtp,:boolean
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :servers,:use_tls
|
||||
remove_column :servers,:for_imap
|
||||
remove_column :servers,:for_smtp
|
||||
end
|
||||
end
|
|
@ -1,9 +0,0 @@
|
|||
class AddDomainToUsers < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :users, :domain, :string
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :users, :domain
|
||||
end
|
||||
end
|
|
@ -1,9 +0,0 @@
|
|||
class AddTypeToFolders < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :folders, :sys, :integer
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :folders, :sys
|
||||
end
|
||||
end
|
|
@ -1,9 +0,0 @@
|
|||
class AddAuthToServers < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :servers, :auth, :string
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :servers, :auth
|
||||
end
|
||||
end
|
|
@ -1,11 +0,0 @@
|
|||
class AddMsgParamsToPrefs < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :prefs, :msg_image_view_as, :string
|
||||
add_column :prefs, :msg_image_thumbnail_size, :string
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :prefs, :msg_image_thumbnail_size
|
||||
remove_column :prefs, :msg_image_view_as
|
||||
end
|
||||
end
|
|
@ -1,9 +0,0 @@
|
|||
class RenameEmailInUser < ActiveRecord::Migration
|
||||
def self.up
|
||||
rename_column :users, :email, :login
|
||||
end
|
||||
|
||||
def self.down
|
||||
rename_column :users, :login, :email
|
||||
end
|
||||
end
|
|
@ -1,17 +0,0 @@
|
|||
class CreateLinks < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :links do |t|
|
||||
t.integer :user_id
|
||||
t.integer :lgroup_id
|
||||
t.string :name
|
||||
t.string :url
|
||||
t.string :info
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :links
|
||||
end
|
||||
end
|
103
db/schema.rb
103
db/schema.rb
|
@ -1,103 +0,0 @@
|
|||
# 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.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20110927091830) do
|
||||
|
||||
create_table "contacts", :force => true do |t|
|
||||
t.string "nick"
|
||||
t.string "email"
|
||||
t.string "first_name"
|
||||
t.string "last_name"
|
||||
t.string "info"
|
||||
t.integer "user_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
create_table "events", :force => true do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "priority"
|
||||
t.text "description"
|
||||
t.string "category"
|
||||
t.datetime "start"
|
||||
t.datetime "stop"
|
||||
t.boolean "allday"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
create_table "folders", :force => true do |t|
|
||||
t.string "name"
|
||||
t.string "delim"
|
||||
t.boolean "haschildren"
|
||||
t.integer "total"
|
||||
t.integer "unseen"
|
||||
t.integer "user_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "parent"
|
||||
t.boolean "shown"
|
||||
t.string "alter_name"
|
||||
t.integer "sys"
|
||||
end
|
||||
|
||||
create_table "messages", :id => false, :force => true do |t|
|
||||
t.integer "folder_id"
|
||||
t.integer "user_id"
|
||||
t.string "msg_id"
|
||||
t.string "from_addr"
|
||||
t.string "to_addr"
|
||||
t.string "subject"
|
||||
t.string "content_type"
|
||||
t.integer "uid"
|
||||
t.integer "size"
|
||||
t.boolean "unseen"
|
||||
t.datetime "date"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
create_table "prefs", :force => true do |t|
|
||||
t.string "theme"
|
||||
t.string "locale"
|
||||
t.integer "user_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "msgs_per_page"
|
||||
t.string "msg_send_type"
|
||||
t.string "msg_image_view_as"
|
||||
t.string "msg_image_thumbnail_size"
|
||||
end
|
||||
|
||||
create_table "servers", :force => true do |t|
|
||||
t.string "name"
|
||||
t.string "port"
|
||||
t.integer "user_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.boolean "use_ssl"
|
||||
t.boolean "use_tls"
|
||||
t.boolean "for_imap"
|
||||
t.boolean "for_smtp"
|
||||
t.string "auth"
|
||||
end
|
||||
|
||||
create_table "users", :force => true do |t|
|
||||
t.string "login"
|
||||
t.string "first_name"
|
||||
t.string "last_name"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "domain"
|
||||
end
|
||||
|
||||
end
|
2
db/seeds.rb
Executable file → Normal file
2
db/seeds.rb
Executable file → Normal file
|
@ -4,4 +4,4 @@
|
|||
# Examples:
|
||||
#
|
||||
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
|
||||
# Mayor.create(:name => 'Daley', :city => cities.first)
|
||||
# Mayor.create(:name => 'Emanuel', :city => cities.first)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue