I'm trying to do a DB migration in Rails using PostgreSQL, but the resulting schema doesn't contain any of my table definitions. Is there something wrong with my syntax that I'm not seeing?
Here's an example of one of my migration files and the resulting schema file after I run "rake db:migrate".
Migration file:
class Fields < ActiveRecord::Migration[5.2]
def change
def up
create_table :fields do |t|
t.column :totalsalesprsn, :float, :limit => nil, :null => false
t.column :totaladmkspend, :float, :limit => nil, :null => false
t.column :totalsalescost, :float, :limit => nil, :null => false
t.column :miscsales, :float, :limit => nil, :null => false
t.column :numleads, :float, :limit => nil, :null => false
t.column :costleads, :float, :limit => nil, :null => false
t.column :totalsalescost2, :float, :limit => nil, :null => false
t.column :totalmarketspent, :float, :limit => nil, :null => false
t.column :numsales, :float, :limit => nil, :null => false
t.column :averagecost, :float, :limit => nil, :null => false
t.column :costpersale, :float, :limit => nil, :null => false
t.column :totalspending, :float, :limit => nil, :null => false
t.column :totalsalesdonate, :float, :limit => nil, :null => false
t.column :totalsales, :float, :limit => nil, :null => false
t.column :pototal, :float, :limit => nil, :null => false
t.column :posales, :float, :limit => nil, :null => false
t.column :form_id, :integer
t.column :created_at, :timestamp
end
end
def down
drop_table :fields
end
end
end
Schema file:
ActiveRecord::Schema.define(version: 2018_10_25_161515) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "fields", force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "forms", force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "tables", force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
end
Would it have something to do with my model files? I have no idea why it's doing this, and I can't post more code, because I would have to add more details to this post in order to avoid the warning that my question doesn't have enough details.