Sha256: 03058c75b8efd19bba8758ce2c457b3b4c714893de02ad753ee5686d576cf278

Contents?: true

Size: 580 Bytes

Versions: 5

Compression:

Stored size: 580 Bytes

Contents

class CreateNotices < ActiveRecord::Migration
  def self.up
    # These are notice messages
    create_table :notices do |t|
      t.string  :content, :null => false, :limit => 1024
      t.boolean :global,  :null => false, :default => true
      t.string  :level,   :null => false
      t.timestamps
    end
    # Global messages have to be acknowledged by every user individually
    create_table :user_notices, :id => false do |t|
      t.references :user
      t.references :notice
    end
  end

  def self.down
    drop_table :user_notices
    drop_table :notices
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_discovery-1.0.0 test/foreman_app/db/migrate/20100625155400_create_notices.rb
foreman_discovery-1.0.0.rc4 test/foreman_app/db/migrate/20100625155400_create_notices.rb
foreman_discovery-1.0.0.rc3 test/foreman_app/db/migrate/20100625155400_create_notices.rb
foreman_discovery-1.0.0.rc2 test/foreman_app/db/migrate/20100625155400_create_notices.rb
foreman_discovery-1.0.0.rc1 test/foreman_app/db/migrate/20100625155400_create_notices.rb