Sha256: 1f3d7d69ef6e70e0afbdbfa6d1d47ed28a1fb5feb98031716cbc663313c190bf

Contents?: true

Size: 1.37 KB

Versions: 1

Compression:

Stored size: 1.37 KB

Contents

class SlightcmsSetup < ActiveRecord::Migration
  def self.up
    # Create layouts-table
    create_table :slightcms_layouts do |t|
      t.string  :name, :null => false
      t.text    :content
      t.timestamps
    end
    
    # Create pages-table
    create_table :slightcms_pages do |t|
      t.integer :parent_id
      t.integer :layout_id
      t.integer :position
      t.string  :path,  :null => false
      t.string  :title, :null => false
      t.string  :slug,  :null => false
      t.string  :keywords
      t.string  :description
      t.boolean :published
      t.timestamps
    end
    add_index :slightcms_pages, :parent_id
    add_index :slightcms_pages, :layout_id
    add_index :slightcms_pages, :path
    add_index :slightcms_pages, :published
    
    # Create page-parts-table
    create_table :slightcms_page_parts do |t|
      t.integer :page_id
      t.string  :name,    :null => false
      t.text    :content, :null => false
      t.timestamps
    end
    add_index :slightcms_page_parts, :page_id
    
    # Create assets-table
    create_table :slightcms_assets do |t|
      t.string  :name
      t.string  :content_type
      t.string  :filename
      t.integer :size
      t.timestamps
    end
    
  end

  def self.down
    drop_table :slightcms_layouts
    drop_table :slightcms_pages
    drop_table :slightcms_page_parts
    drop_table :slightcms_assets
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
slightcms-0.0.11 generators/slightcms_setup/templates/migrate/slightcms_setup_migration.rb