· 8 years ago · Apr 19, 2018, 09:38 AM
1== UseEnumAsOrderType: migrating =============================================
2-- execute(" DROP TRIGGER IF EXISTS tr_denorm_company_manager_orders_changes ON orders.orders;\n DROP TRIGGER IF EXISTS tr_denorm_company_new_orders ON orders.orders;\n DROP TRIGGER IF EXISTS tr_denorm_company_orders_changes ON orders.orders;\n DROP TRIGGER IF EXISTS tr_denorm_user_cart_orders ON orders.orders;\n DROP TRIGGER IF EXISTS tr_denorm_orders_translator ON orders.orders;\n\n DROP INDEX IF EXISTS orders.index_orders_on_properties_tender_id_and_order_type_tender;\n\n CREATE TYPE orders.order_type\n AS ENUM ('message','product','appeal','tender','system_tender','callback');\n\n ALTER TABLE orders.orders ALTER COLUMN order_type SET DATA TYPE orders.order_type\n USING order_type::orders.order_type;\n\n COMMIT;\n")
3NOTICE: trigger "tr_denorm_company_manager_orders_changes" for relation "orders.orders" does not exist, skipping
4NOTICE: trigger "tr_denorm_company_new_orders" for relation "orders.orders" does not exist, skipping
5NOTICE: trigger "tr_denorm_company_orders_changes" for relation "orders.orders" does not exist, skipping
6NOTICE: trigger "tr_denorm_orders_translator" for relation "orders.orders" does not exist, skipping
7rake aborted!
8An error has occurred, this and all later migrations canceled:
9
10PG::FeatureNotSupported: ERROR: cannot alter type of a column used in a trigger definition
11DETAIL: trigger tr_denorm_user_unread_orders_count_by_order_type on table orders.orders depends on column "order_type"
12: DROP TRIGGER IF EXISTS tr_denorm_company_manager_orders_changes ON orders.orders;
13 DROP TRIGGER IF EXISTS tr_denorm_company_new_orders ON orders.orders;
14 DROP TRIGGER IF EXISTS tr_denorm_company_orders_changes ON orders.orders;
15 DROP TRIGGER IF EXISTS tr_denorm_user_cart_orders ON orders.orders;
16 DROP TRIGGER IF EXISTS tr_denorm_orders_translator ON orders.orders;
17
18 DROP INDEX IF EXISTS orders.index_orders_on_properties_tender_id_and_order_type_tender;
19
20 CREATE TYPE orders.order_type
21 AS ENUM ('message','product','appeal','tender','system_tender','callback');
22
23 ALTER TABLE orders.orders ALTER COLUMN order_type SET DATA TYPE orders.order_type
24 USING order_type::orders.order_type;
25
26 COMMIT;
27/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/connection_adapters/postgresql_adapter.rb:650:in `async_exec'
28/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/connection_adapters/postgresql_adapter.rb:650:in `block in execute'
29/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'
30/bundle/2.2/gems/activesupport-3.2.22.5/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
31/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
32/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/connection_adapters/postgresql_adapter.rb:649:in `execute'
33/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/migration.rb:466:in `block in method_missing'
34/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/migration.rb:438:in `block in say_with_time'
35/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/migration.rb:438:in `say_with_time'
36/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/migration.rb:458:in `method_missing'
37/bundle/2.2/bundler/gems/apress-orders-417b48ca6e5a/db/migrate/20170530112520_use_enum_as_order_type.rb:3:in `up'
38/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/migration.rb:410:in `block (2 levels) in migrate'
39/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/migration.rb:410:in `block in migrate'
40/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:129:in `with_connection'
41/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/migration.rb:389:in `migrate'
42/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/migration.rb:528:in `migrate'
43/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/migration.rb:720:in `block (2 levels) in migrate'
44/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/migration.rb:775:in `call'
45/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/migration.rb:775:in `block in ddl_transaction'
46/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
47/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/transactions.rb:208:in `transaction'
48/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/migration.rb:775:in `ddl_transaction'
49/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/migration.rb:719:in `block in migrate'
50/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/migration.rb:700:in `each'
51/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/migration.rb:700:in `migrate'
52/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/migration.rb:570:in `up'
53/bundle/2.2/gems/activerecord-3.2.22.5/lib/active_record/migration.rb:551:in `migrate'
54/app/lib/tasks/rails.rake:26:in `block (2 levels) in <top (required)>'
55/gems/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:75:in `load'
56/gems/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:75:in `kernel_load'
57/gems/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:28:in `run'
58/gems/gems/bundler-1.16.1/lib/bundler/cli.rb:424:in `exec'
59/gems/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
60/gems/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
61/gems/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
62/gems/gems/bundler-1.16.1/lib/bundler/cli.rb:27:in `dispatch'
63/gems/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
64/gems/gems/bundler-1.16.1/lib/bundler/cli.rb:18:in `start'
65/gems/gems/bundler-1.16.1/exe/bundle:30:in `block in <top (required)>'
66/gems/gems/bundler-1.16.1/lib/bundler/friendly_errors.rb:122:in `with_friendly_errors'
67/gems/gems/bundler-1.16.1/exe/bundle:22:in `<top (required)>'
68/gems/bin/bundle:22:in `load'
69/gems/bin/bundle:22:in `<main>'
70Tasks: TOP => db:migrate