Sha256: f9398adde2e2799582f42e5d02cdb2e8a14da7ddfe3f0d4db10d8b9d55a778ab

Contents?: true

Size: 1.13 KB

Versions: 1

Compression:

Stored size: 1.13 KB

Contents

# encoding: UTF-8

Sequel.migration do
  up do
    adapter_scheme =  self.adapter_scheme

    add_column :content, :created_at,         DateTime
    add_column :content, :modified_at,        DateTime

    add_column :content, :first_published_at, DateTime
    add_column :content, :last_published_at,  DateTime

    add_column :content, :first_published_revision,  Integer

    # keeps track of publication dates
    create_table(:revisions) do
      primary_key :id
      integer     :revision
      timestamp   :published_at
    end

    # keeps track of all pages changed by a set of actions
    create_table(:changes) do
      primary_key :id
      varchar     :title
      timestamp   :created_at
      text        :modified_list
    end
  end

  down do
    drop_column :artists, :first_published_at
    drop_column :content, :created_at,         DateTime
    drop_column :content, :modified_at,        DateTime
    drop_column :content, :first_published_at, DateTime
    drop_column :content, :last_published_at,  DateTime
    drop_column :content, :first_published_revision,  Integer
    drop_table :revisions
    drop_table :changes
  end
end



Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spontaneous-0.1.0.alpha1 db/migrations/20101130104334_timestamps.rb