class AddPlacesTable < ActiveRecord::Migration[7.0]
def change
create_table :places, id: :uuid do |t|
t.string :name, null:false
t.string :address, null:false
t.string :city, null:false
t.timestamps
end
end
end
This is my database file and the following is the error it is throwing.
SQLite3::ConstraintException: NOT NULL constraint failed: places.id (ActiveRecord::NotNullViolation)
and my model file is empty it just have a class which is inheriting from ApplicationRecord.
When i start creating a row in my database it shows null for places.id but i think rails should automatically assign it a value since it is a primary key.