SpinaCMS / Spina

Spina CMS
http://www.spinacms.com
Other
2.19k stars 405 forks source link

Error while installing spina with Postgres #232

Closed ghn closed 7 years ago

ghn commented 7 years ago

This is what I get when running spina:install with postgres database. Note that it works with sqlite3

using rails 5.0.2

$ rails g spina:install
Running via Spring preloader in process 28796
      create  config/initializers/spina.rb
      create  config/initializers/carrierwave.rb
       route  mount Spina::Engine => '/'
        rake  spina:install:migrations
Copied migration 20170318095656_create_spina_tables.spina.rb from spina
Copied migration 20170318095657_create_spina_translation_tables.spina.rb from spina
Copied migration 20170318095658_create_spina_navigations.spina.rb from spina
        rake  db:migrate
== 20170318095656 CreateSpinaTables: migrating ================================
-- create_table("spina_accounts", {:force=>:cascade})
   -> 0.0323s
-- create_table("spina_attachment_collections", {:force=>:cascade})
   -> 0.0036s
-- create_table("spina_attachment_collections_attachments", {:force=>:cascade})
   -> 0.0033s
-- create_table("spina_attachments", {:force=>:cascade})
   -> 0.0045s
-- create_table("spina_colors", {:force=>:cascade})
   -> 0.0047s
-- create_table("spina_layout_parts", {:force=>:cascade})
   -> 0.0050s
-- create_table("spina_lines", {:force=>:cascade})
   -> 0.0029s
-- create_table("spina_page_parts", {:force=>:cascade})
   -> 0.0048s
-- create_table("spina_pages", {:force=>:cascade})
   -> 0.0069s
-- create_table("spina_photo_collections", {:force=>:cascade})
   -> 0.0035s
-- create_table("spina_photo_collections_photos", {:force=>:cascade})
   -> 0.0040s
-- create_table("spina_photos", {:force=>:cascade})
   -> 0.0048s
-- create_table("spina_structure_items", {:force=>:cascade})
   -> 0.0032s
-- add_index("spina_structure_items", ["structure_id"], {:name=>"index_spina_structure_items_on_structure_id", :using=>:btree})
   -> 0.0029s
-- create_table("spina_structure_parts", {:force=>:cascade})
   -> 0.0051s
-- add_index("spina_structure_parts", ["structure_item_id"], {:name=>"index_spina_structure_parts_on_structure_item_id", :using=>:btree})
   -> 0.0036s
-- add_index("spina_structure_parts", ["structure_partable_id"], {:name=>"index_spina_structure_parts_on_structure_partable_id", :using=>:btree})
   -> 0.0027s
-- create_table("spina_structures", {:force=>:cascade})
   -> 0.0034s
-- create_table("spina_texts", {:force=>:cascade})
   -> 0.0039s
-- create_table("spina_users", {:force=>:cascade})
   -> 0.0066s
-- create_table("spina_rewrite_rules", {:force=>:cascade})
   -> 0.0050s
== 20170318095656 CreateSpinaTables: migrated (0.1224s) =======================

== 20170318095657 CreateSpinaTranslationTables: migrating =====================
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

PG::UndefinedColumn: ERROR:  column "title" of relation "spina_pages" does not exist
: ALTER TABLE "spina_pages" DROP "title"
/vagrant/db/migrate/20170318095657_create_spina_translation_tables.spina.rb:4:in `up'
ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR:  column "title" of relation "spina_pages" does not exist
: ALTER TABLE "spina_pages" DROP "title"
/vagrant/db/migrate/20170318095657_create_spina_translation_tables.spina.rb:4:in `up'
PG::UndefinedColumn: ERROR:  column "title" of relation "spina_pages" does not exist
/vagrant/db/migrate/20170318095657_create_spina_translation_tables.spina.rb:4:in `up'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
What would you like to name your website? [MySite]
dankmitchell commented 7 years ago

I have a PR raised that should fix this issue.

On Sat, 18 Mar 2017 at 10:00, Germain notifications@github.com wrote:

This is what I get when running spina:install with postgres database. Note that it works with sqlite3

$ rails g spina:install Running via Spring preloader in process 28796 create config/initializers/spina.rb create config/initializers/carrierwave.rb route mount Spina::Engine => '/' rake spina:install:migrations Copied migration 20170318095656_create_spina_tables.spina.rb from spina Copied migration 20170318095657_create_spina_translation_tables.spina.rb from spina Copied migration 20170318095658_create_spina_navigations.spina.rb from spina rake db:migrate == 20170318095656 CreateSpinaTables: migrating ================================ -- create_table("spina_accounts", {:force=>:cascade}) -> 0.0323s -- create_table("spina_attachment_collections", {:force=>:cascade}) -> 0.0036s -- create_table("spina_attachment_collections_attachments", {:force=>:cascade}) -> 0.0033s -- create_table("spina_attachments", {:force=>:cascade}) -> 0.0045s -- create_table("spina_colors", {:force=>:cascade}) -> 0.0047s -- create_table("spina_layout_parts", {:force=>:cascade}) -> 0.0050s -- create_table("spina_lines", {:force=>:cascade}) -> 0.0029s -- create_table("spina_page_parts", {:force=>:cascade}) -> 0.0048s -- create_table("spina_pages", {:force=>:cascade}) -> 0.0069s -- create_table("spina_photo_collections", {:force=>:cascade}) -> 0.0035s -- create_table("spina_photo_collections_photos", {:force=>:cascade}) -> 0.0040s -- create_table("spina_photos", {:force=>:cascade}) -> 0.0048s -- create_table("spina_structure_items", {:force=>:cascade}) -> 0.0032s -- add_index("spina_structure_items", ["structure_id"], {:name=>"index_spina_structure_items_on_structure_id", :using=>:btree}) -> 0.0029s -- create_table("spina_structure_parts", {:force=>:cascade}) -> 0.0051s -- add_index("spina_structure_parts", ["structure_item_id"], {:name=>"index_spina_structure_parts_on_structure_item_id", :using=>:btree}) -> 0.0036s -- add_index("spina_structure_parts", ["structure_partable_id"], {:name=>"index_spina_structure_parts_on_structure_partable_id", :using=>:btree}) -> 0.0027s -- create_table("spina_structures", {:force=>:cascade}) -> 0.0034s -- create_table("spina_texts", {:force=>:cascade}) -> 0.0039s -- create_table("spina_users", {:force=>:cascade}) -> 0.0066s -- create_table("spina_rewrite_rules", {:force=>:cascade}) -> 0.0050s == 20170318095656 CreateSpinaTables: migrated (0.1224s) =======================

== 20170318095657 CreateSpinaTranslationTables: migrating ===================== rake aborted! StandardError: An error has occurred, this and all later migrations canceled:

PG::UndefinedColumn: ERROR: column "title" of relation "spina_pages" does not exist : ALTER TABLE "spina_pages" DROP "title" /vagrant/db/migrate/20170318095657_create_spina_translation_tables.spina.rb:4:in up' ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR: column "title" of relation "spina_pages" does not exist : ALTER TABLE "spina_pages" DROP "title" /vagrant/db/migrate/20170318095657_create_spina_translation_tables.spina.rb:4:inup' PG::UndefinedColumn: ERROR: column "title" of relation "spina_pages" does not exist /vagrant/db/migrate/20170318095657_create_spina_translation_tables.spina.rb:4:in `up' Tasks: TOP => db:migrate (See full trace by running task with --trace) What would you like to name your website? [MySite]

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/denkGroot/Spina/issues/232, or mute the thread https://github.com/notifications/unsubscribe-auth/AC7edjVPsAM5QJUsFcuvPlZiqXhZvpPwks5rm6ssgaJpZM4MhW6T .

-- Kind Regards

Dan Mitchell Managing Director Digital Reflow 07875268905

ghn commented 7 years ago

Hello, in the mean time I also found something in globalize gem. A PR is waiting here https://github.com/globalize/globalize/pull/598

ghn commented 7 years ago

@danmitchell- yeah your PR should fix that. However I'm not sure that is advised to add translatable column in the base model. Anyway, I'll be happy as long as this gets fixed :)

dankmitchell commented 7 years ago

Should be fixed now. Please check and close this issue @ghn

ghn commented 7 years ago

Yes, it works now. Thanks!