the summary of the problem: I'm trying to create a simple crud project to practice and when I create a table using rails g migration create_articles it creates a migration file. So when I add the code
`create_table :articles do |t|
t.string :title
t.text :description
t.timestamps
end`
then run the rails command rails db:migrate a schema file is created, but it is completely empty.
ActiveRecord::Schema[7.0].define(version: 2022_08_21_180236) do
create_table "articles", force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
end
I have
- deleted and re-downloaded everything multiple times using a script found on rubyonmac.com
- I've tried dropping the empty table by generating another migration file and when that gets pushed to the db nothing happens and the table remains
- use
rails db:rollbackand that works but when I rerun the migration file the problem persists
like I said in the beginning of the post I'm using a script I found to setup my MacBook Pro easily so I'm not sure where this problem is coming from. thanks in advance for any help.
edit: also the problem persists across new projects created with command rails new blog or using rails g scaffold Articles to create the migrate files then migrate.