added ads
This commit is contained in:
20
db/migrate/20100215224629_create_advertisements.rb
Normal file
20
db/migrate/20100215224629_create_advertisements.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
class CreateAdvertisements < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :advertisements do |t|
|
||||
t.column :referral_url, :text, :null => false
|
||||
t.column :ad_type, :string, :null => false
|
||||
t.column :status, :string, :null => false
|
||||
t.column :hit_count, :integer, :null => false, :default => 0
|
||||
t.column :width, :integer, :null => false
|
||||
t.column :height, :integer, :null => false
|
||||
t.column :file_name, :string, :null => false
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :advertisements, :ad_type
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :advertisements
|
||||
end
|
||||
end
|
||||
16
db/migrate/20100215224635_create_advertisement_hits.rb
Normal file
16
db/migrate/20100215224635_create_advertisement_hits.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
class CreateAdvertisementHits < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :advertisement_hits do |t|
|
||||
t.column :advertisement_id, :integer, :null => false
|
||||
t.column :ip_addr, "inet", :null => false
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :advertisement_hits, :advertisement_id
|
||||
add_index :advertisement_hits, :created_at
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :advertisement_hits
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user