瀏覽代碼

Change feeds.last_fetched and posts.published to datetime

master
Adrian Short 11 年之前
父節點
當前提交
2dc6636d60
共有 3 個文件被更改,包括 25 次插入3 次删除
  1. +11
    -0
      db/migrate/20130222123833_feeds_change_last_fetched_to_datetime.rb
  2. +11
    -0
      db/migrate/20130222125833_post_published_change_to_datetime.rb
  3. +3
    -3
      db/schema.rb

+ 11
- 0
db/migrate/20130222123833_feeds_change_last_fetched_to_datetime.rb 查看文件

@@ -0,0 +1,11 @@
class FeedsChangeLastFetchedToDatetime < ActiveRecord::Migration
def up
remove_column :feeds, :last_fetched
add_column :feeds, :last_fetched, :datetime
end

def down
remove_column :feeds, :last_fetched
add_column :feeds, :last_fetched, :time
end
end

+ 11
- 0
db/migrate/20130222125833_post_published_change_to_datetime.rb 查看文件

@@ -0,0 +1,11 @@
class PostPublishedChangeToDatetime < ActiveRecord::Migration
def up
remove_column :posts, :published
add_column :posts, :published, :datetime
end

def down
remove_column :posts, :published
add_column :posts, :published, :time
end
end

+ 3
- 3
db/schema.rb 查看文件

@@ -11,7 +11,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.


ActiveRecord::Schema.define(:version => 20130222123224) do
ActiveRecord::Schema.define(:version => 20130222125833) do


create_table "feeds", :force => true do |t| create_table "feeds", :force => true do |t|
t.string "title" t.string "title"
@@ -19,9 +19,9 @@ ActiveRecord::Schema.define(:version => 20130222123224) do
t.string "url" t.string "url"
t.string "description" t.string "description"
t.string "generator" t.string "generator"
t.time "last_fetched"
t.datetime "created_at", :null => false t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
t.datetime "last_fetched"
end end


create_table "posts", :force => true do |t| create_table "posts", :force => true do |t|
@@ -30,13 +30,13 @@ ActiveRecord::Schema.define(:version => 20130222123224) do
t.string "author" t.string "author"
t.text "summary" t.text "summary"
t.text "content" t.text "content"
t.time "published"
t.decimal "lat" t.decimal "lat"
t.decimal "lon" t.decimal "lon"
t.integer "feed_id" t.integer "feed_id"
t.datetime "created_at", :null => false t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
t.string "guid" t.string "guid"
t.datetime "published"
end end


create_table "users", :force => true do |t| create_table "users", :force => true do |t|


Loading…
取消
儲存