add message model and migration
This commit is contained in:
11
db/migrate/20220512140948_create_messages.rb
Normal file
11
db/migrate/20220512140948_create_messages.rb
Normal file
@ -0,0 +1,11 @@
|
||||
class CreateMessages < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
create_table :messages do |t|
|
||||
t.string :title
|
||||
t.text :description
|
||||
t.string :email, null: false
|
||||
t.string :phone
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
11
db/schema.rb
11
db/schema.rb
@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2022_05_12_124755) do
|
||||
ActiveRecord::Schema.define(version: 2022_05_12_140948) do
|
||||
|
||||
create_table "active_admin_comments", force: :cascade do |t|
|
||||
t.string "namespace"
|
||||
@ -38,4 +38,13 @@ ActiveRecord::Schema.define(version: 2022_05_12_124755) do
|
||||
t.index ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true
|
||||
end
|
||||
|
||||
create_table "messages", force: :cascade do |t|
|
||||
t.string "title"
|
||||
t.text "description"
|
||||
t.string "email", null: false
|
||||
t.string "phone"
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -5,5 +5,7 @@
|
||||
#
|
||||
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
|
||||
# Character.create(name: 'Luke', movie: movies.first)
|
||||
AdminUser.create!(email: 'admin@example.com', password: 'password', password_confirmation: 'password') if Rails.env.development?
|
||||
AdminUser.create!(email: 'bijan@example.com', password: '1234567890', password_confirmation: '1234567890') if Rails.env.development?
|
||||
if Rails.env.development?
|
||||
AdminUser.create!(email: 'admin@example.com', password: 'password', password_confirmation: 'password')
|
||||
AdminUser.create!(email: 'bijan@example.com', password: '1234567890', password_confirmation: '1234567890')
|
||||
end
|
||||
|
Reference in New Issue
Block a user