Class: CreateSocialConnections

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/db/migrate/20110516181115_create_social_connections.rb,
lib/generators/social_connections/install/templates/create_social_connections_tables.rb

Class Method Summary collapse

Class Method Details

.downObject



24
25
26
27
# File 'lib/db/migrate/20110516181115_create_social_connections.rb', line 24

def self.down
  drop_table :social_connections
  drop_table :social_activities
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/db/migrate/20110516181115_create_social_connections.rb', line 2

def self.up
  puts "Warning: Migrating via rake is deprecated for social_connections, use 'rails g social_connections:install' instead"
  create_table :social_connections do |t|
    t.integer :source_id
    t.string :source_type
    t.integer :target_id
    t.string :target_type
    t.timestamps
  end
  create_table :social_activities do |t|
    t.integer :owner_id
    t.string :owner_type
    t.integer :subject_id
    t.string :subject_type
    t.integer :target_id
    t.string :target_type
    t.string :verb
    t.text :options_as_json
    t.boolean :unseen, :default => true
    t.timestamps
  end
end