Every repository with this icon (
Every repository with this icon (
| Description: | Desert is a component framework for Rails that allows your plugins have a Rails app like directory structure, routes, migrations, and dependencies. edit |
-
Generator needs to be updated with new route filename "desert_routes.rb"
1 comment Created 7 months ago by nicholasjhenryscript/generate desert_plugin blog
create vendor/plugins/blog create vendor/plugins/blog/app create vendor/plugins/blog/app/controllers create vendor/plugins/blog/app/helpers create vendor/plugins/blog/app/models create vendor/plugins/blog/app/views create vendor/plugins/blog/config create vendor/plugins/blog/config/routes.rbNo such file or directory - /Library/Ruby/Gems/1.8/gems/desert-0.5.0/generators/desert_plugin/templates/routes.rb
Comments
-
backfilling plugin_schema_migrations broken plugin_schema_migrations already exists
0 comments Created 3 months ago by joemooreOn our project we collapsed our migrations, and after the first migration runs we have a
plugin_schema_infotable that looks like this:+----------------+---------+ | plugin_name | version | +----------------+---------+ | tags | 3 | | user | 17 | +----------------+---------+We also have an empty
plugin_schema_migrationstable.Later, we run the following:
class UpgradeUserPluginTo18 < ActiveRecord::Migration def self.up migrate_plugin('user', 18) end ...The code on line 6 of lib/desert/plugin_migrations/2.1/extensions/schema_statements.rb blows up and the exception is eaten silently when the
plugin_schema_migrationsalready exists. The plugin versions are not backfilled and the User plugin migrations run from migration 1.Comments
-
Each time i launch a rake db:migrate (while deploying the community engine plugin, which is based on desert, on a PostgreSQL database) i get the following error :
rake aborted!
An error has occurred, this and all later migrations canceled:RuntimeError: ERROR C25P02 Mcurrent transaction is aborted, commands ignored until end of transaction block Fpostgres.c L906 Rexec_simple_query: SELECT version FROM plugin_schema_migrations WHERE plugin_name = 'community_engine' order by version desc
/home/steph/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract_adapter.rb:212:inlog' /home/steph/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/postgresql_adapter.rb:507:inexecute' /home/steph/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/postgresql_adapter.rb:985:inselect_raw' /home/steph/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/postgresql_adapter.rb:972:inselect' /home/steph/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/database_statements.rb:7:inselect_all_without_query_cache' /home/steph/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/query_cache.rb:62:inselect_all' /home/steph/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/database_statements.rb:13:inselect_one' /var/lib/gems/1.8/gems/desert-0.5.0/lib/desert/plugin_migrations/2.1/migrator.rb:6:incurrent_version' /home/steph/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:384:inmigrate' /var/lib/gems/1.8/gems/desert-0.5.0/lib/desert/plugin_migrations/migrator.rb:16:inmigrate_plugin' /var/lib/gems/1.8/gems/desert-0.5.0/lib/desert/rails/migration.rb:5:inmigrate_plugin' ./db/migrate//20090811094445_community_engine_to_version_62.rb:3:inup_without_benchmarks' /home/steph/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:282:insend' /home/steph/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:282:inmigrate' /usr/lib/ruby/1.8/benchmark.rb:293:inmeasure' /home/steph/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:282:inmigrate' (DELEGATION):2:in__send__' (__DELEGATION__):2:inmigrate' /home/steph/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:486:inmigrate' /home/steph/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:560:incall' /home/steph/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:560:inddl_transaction' /home/steph/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/database_statements.rb:136:intransaction' /home/steph/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:182:intransaction' /home/steph/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:560:inddl_transaction' /home/steph/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:485:inmigrate' /home/steph/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:472:ineach' /home/steph/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:472:inmigrate' /home/steph/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:400:inup' /home/steph/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:383:inmigrate' /home/steph/.gem/ruby/1.8/gems/rails-2.3.2/lib/tasks/databases.rake:116 /home/steph/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:636:incall' /home/steph/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:636:inexecute' /home/steph/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:631:ineach' /home/steph/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:631:inexecute' /home/steph/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:597:ininvoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:insynchronize' /home/steph/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:590:ininvoke_with_call_chain' /home/steph/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:583:ininvoke' /home/steph/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2051:ininvoke_task' /home/steph/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:intop_level' /home/steph/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:ineach' /home/steph/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:intop_level' /home/steph/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2068:instandard_exception_handling' /home/steph/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2023:intop_level' /home/steph/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2001:inrun' /home/steph/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2068:instandard_exception_handling' /home/steph/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:1998:inrun' /home/steph/.gem/ruby/1.8/gems/rake-0.8.7/bin/rake:31 /usr/bin/rake:19:in `load' /usr/bin/rake:19The same deployement on a MySQL database is OK.
Has desert been tested on PostgreSQL ?
For your information, my PostgreSQL database version is 8.3 and my OS is Linux Ubuntu 9.04
Comments
I have a fix for this in my repo - http://github.com/cauta/desert/tree/master . I hope that soon this will be added to the official repo.
Hi,
It appears the integration from cauta's fork happened, but it was done incorrectly; on line 10 the select_all uses plugin_schema_info when it should use plugin_schema_migrations (or even better the variable smt; also that should be used later in the file too :).
I'm still getting my github legs, otherwise I would have proposed a patch for this and theoretically a test to show the error; or is it better etiquette for me to fork this and make the changes there and propose they pick up? Curious for next time.
-
When I do migrations they work, until I try to roll back. I hunted down the bug.
desert-0.5.2/lib/desert/plugin_migrations/2.1/migrator.rb
This line:
ActiveRecord::Base.connection.update("DELETE FROM #{sm_table} WHERE version = '#{version}' WHERE plugin_name = '#{current_plugin.name}'")Should be:
ActiveRecord::Base.connection.update("DELETE FROM #{sm_table} WHERE version = '#{version}' AND plugin_name = '#{current_plugin.name}'")
Now everything works as expected. I would have forked this and sent you my change, but github no longer builds gems =(
Comments












And the patch is here :)
diff --git a/generators/desert_plugin/desert_plugin_generator.rb b/generators/desert_plugin/desert_plugin_generator.rb
index 73122ce..0ef4066 100644
--- a/generators/desert_plugin/desert_plugin_generator.rb +++ b/generators/desert_plugin/desert_plugin_generator.rb @@ -13,7 +13,7 @@ class DesertPluginGenerator < Rails::Generator::NamedBase
m.template "desert_routes.rb", "vendor/plugins/#{file_name}/config/desert_routes.rb" m.map_route_from_plugin
m.directory "vendor/plugins/#{file_name}/db"