docbrown/db/migrate/20200817205048_create_listing_endorsements.rb
Raphael Noriode 30b3592488
[deploy] Listing endorsements: models setup (#9841)
* create listing endorsement model and write test to validate it

* create the classified_listing_endorsements table

* create model associations with seed data and test validations

* modify test and create more seed date for endorsement

* modify the model naming, changed seed data to become radomized and updated the test file

* remove unnecessary function
2020-08-20 11:13:44 +02:00

11 lines
338 B
Ruby

class CreateListingEndorsements < ActiveRecord::Migration[6.0]
def change
create_table :classified_listing_endorsements do |t|
t.string :content
t.boolean :approved, default: false
t.references :classified_listing, foreign_key: true
t.references :user, foreign_key: true
t.timestamps
end
end
end