Class: CreateSocialStream

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/social_stream/templates/migration.rb

Class Method Summary collapse

Class Method Details

.downObject



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/generators/social_stream/templates/migration.rb', line 161

def self.down
  drop_table :activities
  drop_table :activity_object_activities
  drop_table :activity_objects
  drop_table :activity_verbs
  drop_table :actors
  drop_table :comments
  drop_table :group
  drop_table :permissions
  drop_table :posts
  drop_table :_relation_permissions
  drop_table :relations
  drop_table :tags
  drop_table :tags_activity_objects
  drop_table :ties
  drop_table :users
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/generators/social_stream/templates/migration.rb', line 2

def self.up
  create_table "activities", :force => true do |t|
    t.integer  "activity_verb_id"
    t.integer  "tie_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "ancestry"
  end

  add_index "activities", ["activity_verb_id"], :name => "fk_activity_verb"
  add_index "activities", ["tie_id"], :name => "fk_activities_tie"

  create_table "activity_object_activities", :force => true do |t|
    t.integer  "activity_id"
    t.integer  "activity_object_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "type",               :limit => 45
  end

  add_index "activity_object_activities", ["activity_id"], :name => "fk_activity_object_activities_1"
  add_index "activity_object_activities", ["activity_object_id"], :name => "fk_activity_object_activities_2"

  create_table "activity_objects", :force => true do |t|
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "object_type", :limit => 45
  end

  create_table "activity_verbs", :force => true do |t|
    t.string   "name",       :limit => 45
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "actors", :force => true do |t|
    t.string   "name",      :limit => 45
    t.string   "email",     :default => "", :null => false
    t.string   "permalink", :limit => 45
    t.string   "subject_type", :limit => 45
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "activity_object_id"
    t.string   "logo_file_name"
    t.string   "logo_content_type"
    t.integer  "logo_file_size"
    t.datetime "logo_updated_at"
  end

  add_index "actors", ["activity_object_id"], :name => "fk_actors_activity_object"
  add_index "actors", ["email"], :name => "index_actors_on_email"
  add_index "actors", ["permalink"], :name => "index_actors_on_permalink", :unique => true

  create_table "comments", :force => true do |t|
    t.integer  "activity_object_id"
    t.text     "text"
    t.datetime "updated_at"
    t.datetime "created_at"
  end

  add_index "comments", ["activity_object_id"], :name => "fk_commets_activity_object"

  create_table "groups", :force => true do |t|
    t.integer  "actor_id"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "groups", ["actor_id"], :name => "fk_groups_actors"

  create_table "permissions", :force => true do |t|
    t.string   "action"
    t.string   "object"
    t.string   "parameter"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "posts", :force => true do |t|
    t.integer  "activity_object_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.text     "text"
  end

  add_index "posts", ["activity_object_id"], :name => "fk_post_object"

  create_table "relation_permissions", :force => true do |t|
    t.integer  "relation_id"
    t.integer  "permission_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "relation_id"
  end

  add_index "relation_permissions", ["relation_id"], :name => "fk_relation_permissions_relation"
  add_index "relation_permissions", ["permission_id"], :name => "fk_relation_permissions_permission"

  create_table "relations", :force => true do |t|
    t.string   "name",       :limit => 45
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "sender_type"
    t.string   "receiver_type"
    t.string   "ancestry"
    t.integer  "inverse_id"
    t.integer  "granted_id"
    t.boolean  "reflexive", :default => false
  end

  add_index "relations", ["ancestry"]

  create_table "tags", :force => true do |t|
    t.string   "name",       :limit => 45
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "tags_activity_objects", :force => true do |t|
    t.integer "tag_id"
    t.integer "activity_object_id"
  end

  add_index "tags_activity_objects", ["activity_object_id"], :name => "fk_tags_activity_objects_2"
  add_index "tags_activity_objects", ["tag_id"], :name => "fk_tags_activity_objects_1"

  create_table "ties", :force => true do |t|
    t.integer  "sender_id"
    t.integer  "receiver_id"
    t.integer  "relation_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.text     "message"
  end

  add_index "ties", ["receiver_id"], :name => "fk_tie_receiver"
  add_index "ties", ["relation_id"], :name => "fk_tie_relation"
  add_index "ties", ["sender_id"], :name => "fk_tie_sender"

  create_table "users", :force => true do |t|
    t.database_authenticatable :null => false
    t.recoverable
    t.rememberable
    t.trackable

    # t.confirmable
    # t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
    # t.token_authenticatable

    t.timestamps
    t.integer  "actor_id"
  end

  add_index "users", ["actor_id"], :name => "fk_users_actors"
  add_index "users", :reset_password_token, :unique => true
  # add_index :users, :confirmation_token, :unique => true
  # add_index :users, :unlock_token,       :unique => true
end