activerecord-nuodb-adapter 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.DS_Store +0 -0
- data/.travis.yml +26 -2
- data/{CONTRIBUTION.rdoc → CONTRIBUTION.md} +16 -15
- data/Gemfile +1 -1
- data/README.md +48 -0
- data/active_setup_linux.sh +97 -0
- data/activerecord-nuodb-adapter.gemspec +1 -1
- data/lib/active_record/connection_adapters/nuodb/version.rb +1 -1
- data/lib/active_record/connection_adapters/nuodb_adapter.rb +45 -9
- data/test/.DS_Store +0 -0
- data/test/.gitignore +1 -0
- data/test/active_record/connection_adapters/fake_adapter.rb +45 -0
- data/test/ar_schema_test.rb +70 -0
- data/test/assets/example.log +1 -0
- data/test/assets/flowers.jpg +0 -0
- data/test/assets/test.txt +1 -0
- data/test/base_test.rb +1481 -0
- data/test/cases/.DS_Store +0 -0
- data/test/cases/adapter_test.rb +211 -0
- data/test/cases/adapters/firebird/connection_test.rb +8 -0
- data/test/cases/adapters/firebird/default_test.rb +16 -0
- data/test/cases/adapters/firebird/migration_test.rb +124 -0
- data/test/cases/adapters/mysql/active_schema_test.rb +143 -0
- data/test/cases/adapters/mysql/case_sensitivity_test.rb +35 -0
- data/test/cases/adapters/mysql/connection_test.rb +172 -0
- data/test/cases/adapters/mysql/enum_test.rb +10 -0
- data/test/cases/adapters/mysql/mysql_adapter_test.rb +125 -0
- data/test/cases/adapters/mysql/quoting_test.rb +25 -0
- data/test/cases/adapters/mysql/reserved_word_test.rb +153 -0
- data/test/cases/adapters/mysql/schema_test.rb +62 -0
- data/test/cases/adapters/mysql/sp_test.rb +15 -0
- data/test/cases/adapters/mysql/sql_types_test.rb +14 -0
- data/test/cases/adapters/mysql/statement_pool_test.rb +23 -0
- data/test/cases/adapters/mysql2/active_schema_test.rb +143 -0
- data/test/cases/adapters/mysql2/bind_parameter_test.rb +50 -0
- data/test/cases/adapters/mysql2/case_sensitivity_test.rb +35 -0
- data/test/cases/adapters/mysql2/connection_test.rb +97 -0
- data/test/cases/adapters/mysql2/enum_test.rb +10 -0
- data/test/cases/adapters/mysql2/explain_test.rb +26 -0
- data/test/cases/adapters/mysql2/reserved_word_test.rb +152 -0
- data/test/cases/adapters/mysql2/schema_migrations_test.rb +26 -0
- data/test/cases/adapters/mysql2/schema_test.rb +70 -0
- data/test/cases/adapters/mysql2/sql_types_test.rb +14 -0
- data/test/cases/adapters/oracle/synonym_test.rb +17 -0
- data/test/cases/adapters/postgresql/active_schema_test.rb +58 -0
- data/test/cases/adapters/postgresql/array_test.rb +104 -0
- data/test/cases/adapters/postgresql/bytea_test.rb +104 -0
- data/test/cases/adapters/postgresql/connection_test.rb +163 -0
- data/test/cases/adapters/postgresql/datatype_test.rb +604 -0
- data/test/cases/adapters/postgresql/explain_test.rb +28 -0
- data/test/cases/adapters/postgresql/hstore_test.rb +200 -0
- data/test/cases/adapters/postgresql/json_test.rb +99 -0
- data/test/cases/adapters/postgresql/ltree_test.rb +41 -0
- data/test/cases/adapters/postgresql/postgresql_adapter_test.rb +288 -0
- data/test/cases/adapters/postgresql/quoting_test.rb +58 -0
- data/test/cases/adapters/postgresql/schema_authorization_test.rb +114 -0
- data/test/cases/adapters/postgresql/schema_test.rb +376 -0
- data/test/cases/adapters/postgresql/sql_types_test.rb +18 -0
- data/test/cases/adapters/postgresql/statement_pool_test.rb +39 -0
- data/test/cases/adapters/postgresql/timestamp_test.rb +113 -0
- data/test/cases/adapters/postgresql/utils_test.rb +20 -0
- data/test/cases/adapters/postgresql/uuid_test.rb +95 -0
- data/test/cases/adapters/postgresql/view_test.rb +49 -0
- data/test/cases/adapters/sqlite3/copy_table_test.rb +99 -0
- data/test/cases/adapters/sqlite3/explain_test.rb +26 -0
- data/test/cases/adapters/sqlite3/quoting_test.rb +102 -0
- data/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb +366 -0
- data/test/cases/adapters/sqlite3/statement_pool_test.rb +24 -0
- data/test/cases/aggregations_test.rb +158 -0
- data/test/cases/ar_schema_test.rb +70 -0
- data/test/cases/associations/association_scope_test.rb +15 -0
- data/test/cases/associations/belongs_to_associations_test.rb +831 -0
- data/test/cases/associations/callbacks_test.rb +168 -0
- data/test/cases/associations/cascaded_eager_loading_test.rb +179 -0
- data/test/cases/associations/eager_load_includes_full_sti_class_test.rb +36 -0
- data/test/cases/associations/eager_load_nested_include_test.rb +128 -0
- data/test/cases/associations/eager_singularization_test.rb +145 -0
- data/test/cases/associations/eager_test.rb +1179 -0
- data/test/cases/associations/extension_test.rb +80 -0
- data/test/cases/associations/has_and_belongs_to_many_associations_test.rb +779 -0
- data/test/cases/associations/has_many_associations_test.rb +1699 -0
- data/test/cases/associations/has_many_through_associations_test.rb +950 -0
- data/test/cases/associations/has_one_associations_test.rb +525 -0
- data/test/cases/associations/has_one_through_associations_test.rb +317 -0
- data/test/cases/associations/inner_join_association_test.rb +115 -0
- data/test/cases/associations/inverse_associations_test.rb +631 -0
- data/test/cases/associations/join_dependency_test.rb +8 -0
- data/test/cases/associations/join_model_test.rb +750 -0
- data/test/cases/associations/nested_through_associations_test.rb +575 -0
- data/test/cases/associations_test.rb +344 -0
- data/test/cases/attribute_methods/read_test.rb +58 -0
- data/test/cases/attribute_methods/serialization_test.rb +29 -0
- data/test/cases/attribute_methods_test.rb +819 -0
- data/test/cases/autosave_association_test.rb +1447 -0
- data/test/cases/base_test.rb +1481 -0
- data/test/cases/batches_test.rb +173 -0
- data/test/cases/binary_test.rb +49 -0
- data/test/cases/bind_parameter_test.rb +89 -0
- data/test/cases/calculations_test.rb +589 -0
- data/test/cases/callbacks_test.rb +535 -0
- data/test/cases/clone_test.rb +40 -0
- data/test/cases/coders/yaml_column_test.rb +63 -0
- data/test/cases/column_alias_test.rb +17 -0
- data/test/cases/column_definition_test.rb +143 -0
- data/test/cases/column_test.rb +115 -0
- data/test/cases/connection_adapters/abstract_adapter_test.rb +62 -0
- data/test/cases/connection_adapters/connection_handler_test.rb +53 -0
- data/test/cases/connection_adapters/connection_specification_test.rb +12 -0
- data/test/cases/connection_adapters/quoting_test.rb +13 -0
- data/test/cases/connection_adapters/schema_cache_test.rb +56 -0
- data/test/cases/connection_management_test.rb +112 -0
- data/test/cases/connection_pool_test.rb +344 -0
- data/test/cases/connection_specification/resolver_test.rb +63 -0
- data/test/cases/core_test.rb +33 -0
- data/test/cases/counter_cache_test.rb +163 -0
- data/test/cases/custom_locking_test.rb +17 -0
- data/test/cases/database_statements_test.rb +19 -0
- data/test/cases/date_time_test.rb +43 -0
- data/test/cases/defaults_test.rb +214 -0
- data/test/cases/dirty_test.rb +626 -0
- data/test/cases/disconnected_test.rb +27 -0
- data/test/cases/dup_test.rb +136 -0
- data/test/cases/explain_subscriber_test.rb +59 -0
- data/test/cases/explain_test.rb +72 -0
- data/test/cases/finder_respond_to_test.rb +50 -0
- data/test/cases/finder_test.rb +886 -0
- data/test/cases/fixture_set/file_test.rb +83 -0
- data/test/cases/fixtures_test.rb +808 -0
- data/test/cases/forbidden_attributes_protection_test.rb +64 -0
- data/test/cases/habtm_destroy_order_test.rb +61 -0
- data/test/cases/helper.rb +151 -0
- data/test/cases/hot_compatibility_test.rb +54 -0
- data/test/cases/i18n_test.rb +45 -0
- data/test/cases/inheritance_test.rb +355 -0
- data/test/cases/integration_test.rb +87 -0
- data/test/cases/invalid_connection_test.rb +22 -0
- data/test/cases/invalid_date_test.rb +32 -0
- data/test/cases/invertible_migration_test.rb +259 -0
- data/test/cases/json_serialization_test.rb +300 -0
- data/test/cases/locking_test.rb +453 -0
- data/test/cases/log_subscriber_test.rb +129 -0
- data/test/cases/migration/change_schema_test.rb +379 -0
- data/test/cases/migration/change_table_test.rb +204 -0
- data/test/cases/migration/column_attributes_test.rb +186 -0
- data/test/cases/migration/column_positioning_test.rb +60 -0
- data/test/cases/migration/columns_test.rb +279 -0
- data/test/cases/migration/command_recorder_test.rb +247 -0
- data/test/cases/migration/create_join_table_test.rb +125 -0
- data/test/cases/migration/helper.rb +43 -0
- data/test/cases/migration/index_test.rb +209 -0
- data/test/cases/migration/logger_test.rb +37 -0
- data/test/cases/migration/references_index_test.rb +102 -0
- data/test/cases/migration/references_statements_test.rb +111 -0
- data/test/cases/migration/rename_table_test.rb +90 -0
- data/test/cases/migration/table_and_index_test.rb +24 -0
- data/test/cases/migration_test.rb +861 -0
- data/test/cases/migrator_test.rb +378 -0
- data/test/cases/mixin_test.rb +96 -0
- data/test/cases/modules_test.rb +143 -0
- data/test/cases/multiparameter_attributes_test.rb +350 -0
- data/test/cases/multiple_db_test.rb +108 -0
- data/test/cases/nested_attributes_test.rb +1056 -0
- data/test/cases/persistence_test.rb +802 -0
- data/test/cases/pooled_connections_test.rb +51 -0
- data/test/cases/primary_keys_test.rb +218 -0
- data/test/cases/query_cache_test.rb +276 -0
- data/test/cases/quoting_test.rb +229 -0
- data/test/cases/readonly_test.rb +111 -0
- data/test/cases/reaper_test.rb +81 -0
- data/test/cases/reflection_test.rb +386 -0
- data/test/cases/relation/where_chain_test.rb +80 -0
- data/test/cases/relation/where_test.rb +120 -0
- data/test/cases/relation_test.rb +315 -0
- data/test/cases/relations_test.rb +1559 -0
- data/test/cases/reload_models_test.rb +22 -0
- data/test/cases/result_test.rb +32 -0
- data/test/cases/sanitize_test.rb +34 -0
- data/test/cases/schema_dumper_test.rb +391 -0
- data/test/cases/scoping/default_scoping_test.rb +374 -0
- data/test/cases/scoping/named_scoping_test.rb +451 -0
- data/test/cases/scoping/relation_scoping_test.rb +331 -0
- data/test/cases/serialization_test.rb +68 -0
- data/test/cases/serialized_attribute_test.rb +252 -0
- data/test/cases/statement_cache_test.rb +64 -0
- data/test/cases/store_test.rb +153 -0
- data/test/cases/tasks/database_tasks_test.rb +315 -0
- data/test/cases/tasks/mysql_rake_test.rb +301 -0
- data/test/cases/tasks/postgresql_rake_test.rb +236 -0
- data/test/cases/tasks/sqlite_rake_test.rb +191 -0
- data/test/cases/test_case.rb +95 -0
- data/test/cases/test_simple.rb +194 -0
- data/test/cases/timestamp_test.rb +308 -0
- data/test/cases/transaction_callbacks_test.rb +317 -0
- data/test/cases/transaction_isolation_test.rb +114 -0
- data/test/cases/transactions_test.rb +595 -0
- data/test/cases/unconnected_test.rb +33 -0
- data/test/cases/validations/association_validation_test.rb +121 -0
- data/test/cases/validations/i18n_generate_message_validation_test.rb +76 -0
- data/test/cases/validations/i18n_validation_test.rb +89 -0
- data/test/cases/validations/presence_validation_test.rb +51 -0
- data/test/cases/validations/uniqueness_validation_test.rb +379 -0
- data/test/cases/validations_repair_helper.rb +23 -0
- data/test/cases/validations_test.rb +124 -0
- data/test/cases/xml_serialization_test.rb +455 -0
- data/test/cases/yaml_serialization_test.rb +52 -0
- data/test/config.example.yml +154 -0
- data/test/config.rb +5 -0
- data/test/database_statements_test.rb +19 -0
- data/test/fixtures/.gitignore +1 -0
- data/test/fixtures/accounts.yml +29 -0
- data/test/fixtures/admin/accounts.yml +2 -0
- data/test/fixtures/admin/randomly_named_a9.yml +7 -0
- data/test/fixtures/admin/randomly_named_b0.yml +7 -0
- data/test/fixtures/admin/users.yml +10 -0
- data/test/fixtures/all/developers.yml +0 -0
- data/test/fixtures/all/people.yml +0 -0
- data/test/fixtures/all/tasks.yml +0 -0
- data/test/fixtures/author_addresses.yml +5 -0
- data/test/fixtures/author_favorites.yml +4 -0
- data/test/fixtures/authors.yml +15 -0
- data/test/fixtures/binaries.yml +133 -0
- data/test/fixtures/books.yml +9 -0
- data/test/fixtures/cars.yml +9 -0
- data/test/fixtures/categories.yml +19 -0
- data/test/fixtures/categories/special_categories.yml +9 -0
- data/test/fixtures/categories/subsubdir/arbitrary_filename.yml +4 -0
- data/test/fixtures/categories_ordered.yml +7 -0
- data/test/fixtures/categories_posts.yml +31 -0
- data/test/fixtures/categorizations.yml +23 -0
- data/test/fixtures/clubs.yml +8 -0
- data/test/fixtures/collections.yml +3 -0
- data/test/fixtures/colleges.yml +3 -0
- data/test/fixtures/comments.yml +65 -0
- data/test/fixtures/companies.yml +59 -0
- data/test/fixtures/computers.yml +4 -0
- data/test/fixtures/courses.yml +8 -0
- data/test/fixtures/customers.yml +26 -0
- data/test/fixtures/dashboards.yml +6 -0
- data/test/fixtures/developers.yml +21 -0
- data/test/fixtures/developers_projects.yml +17 -0
- data/test/fixtures/dog_lovers.yml +7 -0
- data/test/fixtures/dogs.yml +4 -0
- data/test/fixtures/edges.yml +5 -0
- data/test/fixtures/entrants.yml +14 -0
- data/test/fixtures/essays.yml +6 -0
- data/test/fixtures/faces.yml +11 -0
- data/test/fixtures/fk_test_has_fk.yml +3 -0
- data/test/fixtures/fk_test_has_pk.yml +2 -0
- data/test/fixtures/friendships.yml +4 -0
- data/test/fixtures/funny_jokes.yml +10 -0
- data/test/fixtures/interests.yml +33 -0
- data/test/fixtures/items.yml +3 -0
- data/test/fixtures/jobs.yml +7 -0
- data/test/fixtures/legacy_things.yml +3 -0
- data/test/fixtures/mateys.yml +4 -0
- data/test/fixtures/member_details.yml +8 -0
- data/test/fixtures/member_types.yml +6 -0
- data/test/fixtures/members.yml +11 -0
- data/test/fixtures/memberships.yml +34 -0
- data/test/fixtures/men.yml +5 -0
- data/test/fixtures/minimalistics.yml +2 -0
- data/test/fixtures/minivans.yml +5 -0
- data/test/fixtures/mixed_case_monkeys.yml +6 -0
- data/test/fixtures/mixins.yml +29 -0
- data/test/fixtures/movies.yml +7 -0
- data/test/fixtures/naked/csv/accounts.csv +1 -0
- data/test/fixtures/naked/yml/accounts.yml +1 -0
- data/test/fixtures/naked/yml/companies.yml +1 -0
- data/test/fixtures/naked/yml/courses.yml +1 -0
- data/test/fixtures/organizations.yml +5 -0
- data/test/fixtures/other_topics.yml +42 -0
- data/test/fixtures/owners.yml +8 -0
- data/test/fixtures/parrots.yml +27 -0
- data/test/fixtures/parrots_pirates.yml +7 -0
- data/test/fixtures/people.yml +24 -0
- data/test/fixtures/peoples_treasures.yml +3 -0
- data/test/fixtures/pets.yml +19 -0
- data/test/fixtures/pirates.yml +9 -0
- data/test/fixtures/posts.yml +82 -0
- data/test/fixtures/price_estimates.yml +7 -0
- data/test/fixtures/products.yml +4 -0
- data/test/fixtures/projects.yml +7 -0
- data/test/fixtures/randomly_named_a9.yml +7 -0
- data/test/fixtures/ratings.yml +14 -0
- data/test/fixtures/readers.yml +11 -0
- data/test/fixtures/references.yml +17 -0
- data/test/fixtures/reserved_words/distinct.yml +5 -0
- data/test/fixtures/reserved_words/distinct_select.yml +11 -0
- data/test/fixtures/reserved_words/group.yml +14 -0
- data/test/fixtures/reserved_words/select.yml +8 -0
- data/test/fixtures/reserved_words/values.yml +7 -0
- data/test/fixtures/ships.yml +6 -0
- data/test/fixtures/speedometers.yml +8 -0
- data/test/fixtures/sponsors.yml +12 -0
- data/test/fixtures/string_key_objects.yml +7 -0
- data/test/fixtures/subscribers.yml +11 -0
- data/test/fixtures/subscriptions.yml +12 -0
- data/test/fixtures/taggings.yml +78 -0
- data/test/fixtures/tags.yml +11 -0
- data/test/fixtures/tasks.yml +7 -0
- data/test/fixtures/teapots.yml +3 -0
- data/test/fixtures/topics.yml +42 -0
- data/test/fixtures/toys.yml +14 -0
- data/test/fixtures/traffic_lights.yml +10 -0
- data/test/fixtures/treasures.yml +10 -0
- data/test/fixtures/variants.yml +4 -0
- data/test/fixtures/vegetables.yml +20 -0
- data/test/fixtures/vertices.yml +4 -0
- data/test/fixtures/warehouse-things.yml +3 -0
- data/test/fixtures/zines.yml +5 -0
- data/test/migration_test.rb +861 -0
- data/test/migrations/10_urban/9_add_expressions.rb +11 -0
- data/test/migrations/decimal/1_give_me_big_numbers.rb +15 -0
- data/test/migrations/empty/.gitkeep +0 -0
- data/test/migrations/magic/1_currencies_have_symbols.rb +12 -0
- data/test/migrations/missing/1000_people_have_middle_names.rb +9 -0
- data/test/migrations/missing/1_people_have_last_names.rb +9 -0
- data/test/migrations/missing/3_we_need_reminders.rb +12 -0
- data/test/migrations/missing/4_innocent_jointable.rb +12 -0
- data/test/migrations/rename/1_we_need_things.rb +11 -0
- data/test/migrations/rename/2_rename_things.rb +9 -0
- data/test/migrations/to_copy/1_people_have_hobbies.rb +9 -0
- data/test/migrations/to_copy/2_people_have_descriptions.rb +9 -0
- data/test/migrations/to_copy2/1_create_articles.rb +7 -0
- data/test/migrations/to_copy2/2_create_comments.rb +7 -0
- data/test/migrations/to_copy_with_name_collision/1_people_have_hobbies.rb +9 -0
- data/test/migrations/to_copy_with_timestamps/20090101010101_people_have_hobbies.rb +9 -0
- data/test/migrations/to_copy_with_timestamps/20090101010202_people_have_descriptions.rb +9 -0
- data/test/migrations/to_copy_with_timestamps2/20090101010101_create_articles.rb +7 -0
- data/test/migrations/to_copy_with_timestamps2/20090101010202_create_comments.rb +7 -0
- data/test/migrations/valid/1_valid_people_have_last_names.rb +9 -0
- data/test/migrations/valid/2_we_need_reminders.rb +12 -0
- data/test/migrations/valid/3_innocent_jointable.rb +12 -0
- data/test/migrations/valid_with_subdirectories/1_valid_people_have_last_names.rb +9 -0
- data/test/migrations/valid_with_subdirectories/sub/2_we_need_reminders.rb +12 -0
- data/test/migrations/valid_with_subdirectories/sub1/3_innocent_jointable.rb +12 -0
- data/test/migrations/valid_with_timestamps/20100101010101_valid_with_timestamps_people_have_last_names.rb +9 -0
- data/test/migrations/valid_with_timestamps/20100201010101_valid_with_timestamps_we_need_reminders.rb +12 -0
- data/test/migrations/valid_with_timestamps/20100301010101_valid_with_timestamps_innocent_jointable.rb +12 -0
- data/test/models/admin.rb +5 -0
- data/test/models/admin/account.rb +3 -0
- data/test/models/admin/randomly_named_c1.rb +3 -0
- data/test/models/admin/user.rb +39 -0
- data/test/models/aircraft.rb +4 -0
- data/test/models/arunit2_model.rb +3 -0
- data/test/models/author.rb +196 -0
- data/test/models/auto_id.rb +4 -0
- data/test/models/autoloadable/extra_firm.rb +2 -0
- data/test/models/binary.rb +2 -0
- data/test/models/bird.rb +12 -0
- data/test/models/book.rb +9 -0
- data/test/models/boolean.rb +2 -0
- data/test/models/bulb.rb +45 -0
- data/test/models/car.rb +28 -0
- data/test/models/categorization.rb +19 -0
- data/test/models/category.rb +34 -0
- data/test/models/citation.rb +6 -0
- data/test/models/club.rb +15 -0
- data/test/models/college.rb +5 -0
- data/test/models/column_name.rb +3 -0
- data/test/models/comment.rb +38 -0
- data/test/models/company.rb +214 -0
- data/test/models/company_in_module.rb +80 -0
- data/test/models/computer.rb +3 -0
- data/test/models/contact.rb +40 -0
- data/test/models/contract.rb +19 -0
- data/test/models/country.rb +7 -0
- data/test/models/course.rb +6 -0
- data/test/models/customer.rb +77 -0
- data/test/models/dashboard.rb +3 -0
- data/test/models/default.rb +2 -0
- data/test/models/developer.rb +250 -0
- data/test/models/dog.rb +5 -0
- data/test/models/dog_lover.rb +5 -0
- data/test/models/edge.rb +5 -0
- data/test/models/electron.rb +3 -0
- data/test/models/engine.rb +4 -0
- data/test/models/entrant.rb +3 -0
- data/test/models/essay.rb +5 -0
- data/test/models/event.rb +3 -0
- data/test/models/eye.rb +37 -0
- data/test/models/face.rb +7 -0
- data/test/models/friendship.rb +6 -0
- data/test/models/guid.rb +2 -0
- data/test/models/interest.rb +5 -0
- data/test/models/invoice.rb +4 -0
- data/test/models/item.rb +7 -0
- data/test/models/job.rb +7 -0
- data/test/models/joke.rb +7 -0
- data/test/models/keyboard.rb +3 -0
- data/test/models/legacy_thing.rb +3 -0
- data/test/models/lesson.rb +11 -0
- data/test/models/line_item.rb +3 -0
- data/test/models/liquid.rb +4 -0
- data/test/models/man.rb +9 -0
- data/test/models/matey.rb +4 -0
- data/test/models/member.rb +36 -0
- data/test/models/member_detail.rb +7 -0
- data/test/models/member_type.rb +3 -0
- data/test/models/membership.rb +15 -0
- data/test/models/minimalistic.rb +2 -0
- data/test/models/minivan.rb +9 -0
- data/test/models/mixed_case_monkey.rb +3 -0
- data/test/models/molecule.rb +4 -0
- data/test/models/movie.rb +5 -0
- data/test/models/order.rb +4 -0
- data/test/models/organization.rb +12 -0
- data/test/models/owner.rb +5 -0
- data/test/models/parrot.rb +29 -0
- data/test/models/person.rb +128 -0
- data/test/models/pet.rb +15 -0
- data/test/models/pirate.rb +86 -0
- data/test/models/possession.rb +3 -0
- data/test/models/post.rb +194 -0
- data/test/models/price_estimate.rb +4 -0
- data/test/models/project.rb +30 -0
- data/test/models/randomly_named_c1.rb +3 -0
- data/test/models/rating.rb +4 -0
- data/test/models/reader.rb +21 -0
- data/test/models/reference.rb +22 -0
- data/test/models/reply.rb +61 -0
- data/test/models/ship.rb +19 -0
- data/test/models/ship_part.rb +7 -0
- data/test/models/shop.rb +12 -0
- data/test/models/speedometer.rb +6 -0
- data/test/models/sponsor.rb +7 -0
- data/test/models/string_key_object.rb +3 -0
- data/test/models/student.rb +3 -0
- data/test/models/subject.rb +16 -0
- data/test/models/subscriber.rb +8 -0
- data/test/models/subscription.rb +4 -0
- data/test/models/tag.rb +7 -0
- data/test/models/tagging.rb +13 -0
- data/test/models/task.rb +5 -0
- data/test/models/topic.rb +121 -0
- data/test/models/toy.rb +6 -0
- data/test/models/traffic_light.rb +4 -0
- data/test/models/treasure.rb +11 -0
- data/test/models/treaty.rb +7 -0
- data/test/models/tyre.rb +3 -0
- data/test/models/vegetables.rb +24 -0
- data/test/models/vertex.rb +9 -0
- data/test/models/warehouse_thing.rb +5 -0
- data/test/models/wheel.rb +3 -0
- data/test/models/without_table.rb +3 -0
- data/test/models/zine.rb +3 -0
- data/test/schema/mysql2_specific_schema.rb +58 -0
- data/test/schema/mysql_specific_schema.rb +70 -0
- data/test/schema/oracle_specific_schema.rb +46 -0
- data/test/schema/postgresql_specific_schema.rb +224 -0
- data/test/schema/schema.rb +809 -0
- data/test/schema/sqlite_specific_schema.rb +25 -0
- data/test/support/config.rb +43 -0
- data/test/support/connection.rb +21 -0
- metadata +898 -6
- data/README.rdoc +0 -42
data/.DS_Store
ADDED
Binary file
|
data/.travis.yml
CHANGED
@@ -4,9 +4,30 @@ rvm:
|
|
4
4
|
- 1.9.3
|
5
5
|
|
6
6
|
env:
|
7
|
+
- NUODB_ROOT=/opt/nuodb NUODB_VERSION=1.2
|
8
|
+
- NUODB_ROOT=/opt/nuodb NUODB_VERSION=1.1.1
|
9
|
+
- NUODB_ROOT=/opt/nuodb NUODB_VERSION=1.1
|
7
10
|
- NUODB_ROOT=/opt/nuodb NUODB_VERSION=1.0.2
|
8
11
|
- NUODB_ROOT=/opt/nuodb NUODB_VERSION=1.0.1
|
9
12
|
|
13
|
+
install:
|
14
|
+
- gem install bundler
|
15
|
+
- gem install thread_safe
|
16
|
+
- gem install minitest
|
17
|
+
- gem install io-console
|
18
|
+
- gem install atomic
|
19
|
+
- gem install bigdecimal
|
20
|
+
- gem install mocha
|
21
|
+
- sudo apt-get update
|
22
|
+
- sudo apt-get install libtool libxml2 openssl sqlite
|
23
|
+
- sudo apt-get install rbenv
|
24
|
+
#- rbenv install 1.9.3-p392
|
25
|
+
#- rbenv global 1.9.3-p392
|
26
|
+
#- rbenv rehash
|
27
|
+
- gem install nuodb
|
28
|
+
- gem install activerecord-nuodb-adapter
|
29
|
+
- gem install rails -v "=3.2.8"
|
30
|
+
|
10
31
|
notifications:
|
11
32
|
recipients:
|
12
33
|
- buck.robert.j@gmail.com
|
@@ -17,6 +38,7 @@ before_install:
|
|
17
38
|
- wget http://www.nuodb.com/latest/releases/nuodb-${NUODB_VERSION}.linux.x64.deb --output-document=/var/tmp/nuodb.deb
|
18
39
|
- sudo dpkg -i /var/tmp/nuodb.deb
|
19
40
|
- sleep 2
|
41
|
+
- sudo chmod 777 active_setup_linux.sh
|
20
42
|
|
21
43
|
before_script:
|
22
44
|
- ${NUODB_ROOT}/bin/nuodb --chorus test --password bar --dba-user dba --dba-password baz --verbose debug --archive /var/tmp/nuodb --initialize --force &
|
@@ -24,9 +46,11 @@ before_script:
|
|
24
46
|
- ${NUODB_ROOT}/bin/nuodb --chorus test --password bar --dba-user dba --dba-password baz &
|
25
47
|
- sleep 2
|
26
48
|
- echo "create user cloud password 'user';" | ${NUODB_ROOT}/bin/nuosql test@localhost --user dba --password baz
|
49
|
+
- sleep 10
|
27
50
|
|
28
51
|
script:
|
29
|
-
-
|
52
|
+
- ./active_setup_linux.sh
|
53
|
+
- ARCONN=nuodb ruby -I~/tmpy/rails-latest/:~/tmpy/rails-latest/activerecord/test/:/home/travis/.rvm/gems/ruby-1.9.3-p448/gems/mocha-0.14.0/lib/ ~/tmpy/rails-latest/activerecord/test/cases/migration_test.rb
|
30
54
|
|
31
55
|
after_script:
|
32
|
-
- sudo dpkg -r nuodb
|
56
|
+
- sudo dpkg -r nuodb
|
@@ -1,12 +1,12 @@
|
|
1
|
-
|
1
|
+
# Contributing to the Ruby ActiveRecord NuoDB Adapter
|
2
2
|
|
3
|
-
|
3
|
+
## BUILDING THE GEM
|
4
4
|
|
5
5
|
To compile and test run this command:
|
6
6
|
|
7
7
|
rake clean build
|
8
8
|
|
9
|
-
|
9
|
+
## INSTALLING THE GEM
|
10
10
|
|
11
11
|
gem install activerecord-nuodb-adapter
|
12
12
|
|
@@ -18,7 +18,7 @@ Or you can do this using Rake:
|
|
18
18
|
|
19
19
|
rake clean build uninstall install
|
20
20
|
|
21
|
-
|
21
|
+
## TESTING THE GEM
|
22
22
|
|
23
23
|
Start up a minimal chorus as follows:
|
24
24
|
|
@@ -35,11 +35,12 @@ Run the tests:
|
|
35
35
|
|
36
36
|
rake test
|
37
37
|
|
38
|
-
|
38
|
+
## PUBLISHING THE GEM
|
39
39
|
|
40
|
-
|
40
|
+
### TAGGING
|
41
41
|
|
42
|
-
Tag the product using tags per the SemVer specification; our tags have a
|
42
|
+
Tag the product using tags per the SemVer specification; our tags have a
|
43
|
+
v-prefix:
|
43
44
|
|
44
45
|
git tag -a v1.0.1 -m "SemVer Version: v1.0.1"
|
45
46
|
git push --tags
|
@@ -49,29 +50,29 @@ If you make a mistake, take it back quickly:
|
|
49
50
|
git tag -d v1.0.1
|
50
51
|
git push origin :refs/tags/v1.0.1
|
51
52
|
|
52
|
-
|
53
|
+
### PUBLISHING
|
53
54
|
|
54
55
|
Here are the commands used to publish:
|
55
56
|
|
56
57
|
gem push pkg/activerecord-nuodb-adapter-1.0.1.gem
|
57
58
|
|
58
|
-
|
59
|
+
## INSPECTING THE GEM
|
59
60
|
|
60
|
-
It is often useful to inspect the contents of a Gem before distribution.
|
61
|
-
|
61
|
+
It is often useful to inspect the contents of a Gem before distribution. To do
|
62
|
+
this you dump the contents of a gem thus:
|
62
63
|
|
63
64
|
gem unpack pkg/activerecord-nuodb-adapter-1.0.1.gem
|
64
65
|
|
65
|
-
|
66
|
+
## RUNNING ACTIVE RECORD COMPLIANCE TEST SUITES
|
66
67
|
|
67
68
|
Install both the NuoDB Ruby Gem and the NuoDB ActiveRecord Adapter Gem:
|
68
69
|
|
69
70
|
gem install nuodb
|
70
71
|
gem install activerecord-nuodb-adapter
|
71
72
|
|
72
|
-
You may need to uninstall an earlier version to ensure you only have
|
73
|
-
|
74
|
-
|
73
|
+
You may need to uninstall an earlier version to ensure you only have the
|
74
|
+
version you want to install:
|
75
|
+
|
75
76
|
gem uninstall activerecord-nuodb-adapter
|
76
77
|
|
77
78
|
Run equivalent commands to the following to set up your environment:
|
data/Gemfile
CHANGED
data/README.md
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# Ruby ActiveRecord NuoDB Adapter [<img src="https://secure.travis-ci.org/nuodb/ruby-activerecord-nuodb-adapter.png?branch=master" alt="Continuous Integration Status" />](http://travis-ci.org/nuodb/ruby-activerecord-nuodb-adapter) [<img src="https://gemnasium.com/nuodb/ruby-activerecord-nuodb-adapter.png?travis" alt="Dependency Status" />](https://gemnasium.com/nuodb/ruby-activerecord-nuodb-adapter) [<img src="https://codeclimate.com/github/nuodb/ruby-activerecord-nuodb-adapter.png" />](https://codeclimate.com/github/nuodb/ruby-activerecord-nuodb-adapter)
|
2
|
+
|
3
|
+
The Ruby ActiveRecord NuoDB Adapter enables the ActiveRecord ORM to work with [NuoDB](http://nuodb.com/). Together with the [Ruby NuoDB driver](https://github.com/nuodb/ruby-nuodb), this gem allows for NuoDB backed Rails applications.
|
4
|
+
|
5
|
+
Note: At this time the Ruby ActiveRecord NuoDB Adapter does not support Windows.
|
6
|
+
|
7
|
+
## Getting Started
|
8
|
+
|
9
|
+
1. If you haven't already, [Download and Install NuoDB](http://nuodb.com/download-nuodb/)
|
10
|
+
|
11
|
+
2. Add the ActiveRecord NuoDB Adapter to your Gemfile
|
12
|
+
|
13
|
+
gem 'activerecord-nuodb-adapter'
|
14
|
+
|
15
|
+
3. Use bundler to install
|
16
|
+
|
17
|
+
bundle install
|
18
|
+
|
19
|
+
4. Use the NuoDB Manager to create your database by starting a Storage
|
20
|
+
Manager (SM) and Transaction Engine (TE)
|
21
|
+
|
22
|
+
java -jar /opt/nuodb/jar/nuodbmanager.jar --broker localhost --user domain --password bird
|
23
|
+
|
24
|
+
> start process sm host localhost database blog_development archive /var/opt/nuodb/production-archives/blog_development initialize yes
|
25
|
+
> start process te host localhost database blog_development options '--dba-user blog --dba-password bl0gPassw0rd'
|
26
|
+
|
27
|
+
5. Update your config/database.yml file
|
28
|
+
|
29
|
+
development:
|
30
|
+
adapter: nuodb
|
31
|
+
database: blog_development@localhost
|
32
|
+
username: blog
|
33
|
+
password: bl0gPassw0rd
|
34
|
+
schema: blog
|
35
|
+
|
36
|
+
|
37
|
+
## More Information
|
38
|
+
|
39
|
+
* [NuoDB Community Forum](http://www.nuodb.com/community/forum.php)
|
40
|
+
* [NuoDB Online Documentation](http://www.nuodb.com/community/documentation.php)
|
41
|
+
|
42
|
+
|
43
|
+
## Contributing
|
44
|
+
|
45
|
+
See [Contribution](CONTRIBUTION.md) for information about contributing to
|
46
|
+
the Ruby ActiveRecord NuoDB Adapter.
|
47
|
+
|
48
|
+
[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/48a7777cbd0353a0b8e4cb380f2e530f "githalytics.com")](http://githalytics.com/nuodb/ruby-activerecord-nuodb-adapter)
|
@@ -0,0 +1,97 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
#Script to set up activerecord tests on Ubuntu
|
3
|
+
|
4
|
+
#installing dependencies
|
5
|
+
# sudo apt-get update
|
6
|
+
# sudo apt-get install libtool libxml2 openssl sqlite
|
7
|
+
# sudo apt-get install rbenv
|
8
|
+
# sudo apt-get install ruby-build
|
9
|
+
|
10
|
+
echo "eval \"\$(rbenv init -)\"" >> ~/.bash_profile
|
11
|
+
|
12
|
+
# rbenv install 1.9.3-p392
|
13
|
+
# rbenv global 1.9.3-p392
|
14
|
+
# rbenv rehash
|
15
|
+
eval "$(rbenv init -)"
|
16
|
+
|
17
|
+
# sudo gem list | cut -d" " -f1 | xargs gem uninstall -aIx
|
18
|
+
# gem install bundler
|
19
|
+
|
20
|
+
# Writes to .bash_profile
|
21
|
+
echo "export NUODB_ROOT=/opt/nuodb/bin
|
22
|
+
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function" >> ~/.bash_profile
|
23
|
+
|
24
|
+
cd ~/
|
25
|
+
mkdir tmpy
|
26
|
+
git clone https://github.com/nuodb/ruby-nuodb.git ~/tmpy/ruby-nuodb-latest
|
27
|
+
cd ~/tmpy/ruby-nuodb-latest
|
28
|
+
bundle
|
29
|
+
rbenv rehash
|
30
|
+
|
31
|
+
cd ~/tmpy/ruby-nuodb-latest
|
32
|
+
chmod 777 nuodb.gemspec
|
33
|
+
sed -i '/README.rdoc/d' ./nuodb.gemspec #Removes README.rdoc to resolve rake errors
|
34
|
+
gem build nuodb.gemspec
|
35
|
+
#rake clean build
|
36
|
+
#cd pkg
|
37
|
+
sudo gem install nuodb-1.0.2.gem
|
38
|
+
|
39
|
+
#Getting the driver
|
40
|
+
# git clone https://github.com/nuodb/ruby-activerecord-nuodb-adapter.git ~/tmpy/ruby-activerecord-nuodb-adapter-latest
|
41
|
+
# cd ~/tmpy/ruby-activerecord-nuodb-adapter-latest
|
42
|
+
# bundle
|
43
|
+
# rbenv rehash
|
44
|
+
# rake clean build
|
45
|
+
# cd pkg
|
46
|
+
# gem install activerecord-nuodb-adapter-1.0.3.gem #Make robust
|
47
|
+
|
48
|
+
#Getting rails
|
49
|
+
git clone https://github.com/rails/rails.git ~/tmpy/rails-latest
|
50
|
+
cd ~/tmpy/rails-latest
|
51
|
+
git checkout v3.2.8
|
52
|
+
bundle
|
53
|
+
rbenv rehash
|
54
|
+
cd activerecord
|
55
|
+
|
56
|
+
echo "if ENV['NUODB_AR']
|
57
|
+
gem 'activerecord-nuodb-adapter'
|
58
|
+
end" >> ~/tmpy/rails-latest/Gemfile
|
59
|
+
|
60
|
+
echo "
|
61
|
+
nuodb:
|
62
|
+
arunit:
|
63
|
+
host: localhost
|
64
|
+
database: test@localhost
|
65
|
+
username: cloud
|
66
|
+
password: user
|
67
|
+
schema: test
|
68
|
+
arunit2:
|
69
|
+
host: localhost
|
70
|
+
database: test@localhost
|
71
|
+
username: cloud
|
72
|
+
password: user
|
73
|
+
schema: test
|
74
|
+
" >> ~/tmpy/rails-latest/activerecord/test/config.example.yml
|
75
|
+
|
76
|
+
sed -i 's/%w( mysql mysql2 postgresql/%w( nuodb mysql mysql2 postgresql/g' Rakefile
|
77
|
+
|
78
|
+
echo "gem 'activerecord-nuodb-adapter'" >> ~/tmpy/rails-latest/Gemfile
|
79
|
+
bundle install
|
80
|
+
|
81
|
+
export GEM_PATH=/home/travis/.rvm/gems/ruby-1.9.3-p448
|
82
|
+
|
83
|
+
#RUBYLIB="~/tmpy/rails-latest/activerecord/test/cases:$RUBYLIB"
|
84
|
+
#export RUBYLIB
|
85
|
+
|
86
|
+
|
87
|
+
# Helpful information, make sure that NuoDB is running
|
88
|
+
|
89
|
+
# Starting NuoDB
|
90
|
+
#java -jar /opt/nuodb/jar/nuoagent.jar --broker &
|
91
|
+
#/opt/nuodb/bin/nuodb --chorus test --password bar --dba-user cloud --dba-password user --verbose debug --archive /var/tmp/nuodb --initialize --force &
|
92
|
+
#/opt/nuodb/bin/nuodb --chorus test --password bar --dba-user cloud --dba-password user &
|
93
|
+
|
94
|
+
# Running Tests
|
95
|
+
#cd /tmp/rails-latest/activerecord
|
96
|
+
#ARCONN=nuodb ruby -Itest test/cases/base_test.rb
|
97
|
+
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
|
|
12
12
|
gem.license = 'BSD'
|
13
13
|
|
14
14
|
gem.rdoc_options = %w(--charset=UTF-8)
|
15
|
-
gem.extra_rdoc_files = %w[README.
|
15
|
+
gem.extra_rdoc_files = %w[README.md]
|
16
16
|
|
17
17
|
gem.add_dependency('activerecord', '~> 3.2.11')
|
18
18
|
gem.add_development_dependency('rake', '~> 10.0.3')
|
@@ -37,11 +37,8 @@ require 'arel/visitors/bind_visitor'
|
|
37
37
|
require 'active_support/core_ext/hash/keys'
|
38
38
|
|
39
39
|
require 'nuodb'
|
40
|
-
|
41
40
|
module ActiveRecord
|
42
|
-
|
43
41
|
class Base
|
44
|
-
|
45
42
|
def self.nuodb_connection(config) #:nodoc:
|
46
43
|
config.symbolize_keys!
|
47
44
|
unless config[:database]
|
@@ -52,7 +49,6 @@ module ActiveRecord
|
|
52
49
|
config.reverse_merge! :timezone => 'UTC'
|
53
50
|
ConnectionAdapters::NuoDBAdapter.new nil, logger, nil, config
|
54
51
|
end
|
55
|
-
|
56
52
|
end
|
57
53
|
|
58
54
|
class LostConnection < WrappedDatabaseException
|
@@ -179,6 +175,8 @@ module ActiveRecord
|
|
179
175
|
:date
|
180
176
|
when /string/i then
|
181
177
|
:text
|
178
|
+
when /binarystring/i then
|
179
|
+
:binary
|
182
180
|
else
|
183
181
|
super
|
184
182
|
end
|
@@ -499,14 +497,39 @@ module ActiveRecord
|
|
499
497
|
raise NotImplementedError, "rename_table is not implemented"
|
500
498
|
#execute("RENAME TABLE #{quote_table_name(table_name)} TO #{quote_table_name(new_name)}")
|
501
499
|
end
|
500
|
+
|
501
|
+
#Carlos Added Begins
|
502
502
|
|
503
503
|
def add_column(table_name, column_name, type, options = {})
|
504
504
|
clear_cache!
|
505
|
-
|
506
|
-
|
507
|
-
|
505
|
+
#Stored procedure not supported
|
506
|
+
#add_column_sql = "CREATE PROCEDURE PR1 BEGIN IF NOT EXISTS((SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA=DATABASE()
|
507
|
+
# AND COLUMN_NAME=#{quote_column_name(column_name)} AND TABLE_NAME=#{quote_table_name(table_name)})) THEN ALTER TABLE #{quote_table_name(table_name)} ADD COLUMN #{quote_column_name(column_name)} #{type.to_s} END IF"
|
508
|
+
if column_exists?(table_name, column_name) == false
|
509
|
+
add_column_sql = "ALTER TABLE #{quote_table_name(table_name)} ADD COLUMN #{quote_column_name(column_name)} #{type.to_s}"
|
510
|
+
add_column_options!(add_column_sql, options)
|
511
|
+
execute(add_column_sql)
|
512
|
+
end
|
508
513
|
end
|
509
514
|
|
515
|
+
def add_index(table_name, column_name, options = {})
|
516
|
+
index_name, index_type, index_columns = add_index_options(table_name, column_name, options)
|
517
|
+
if okay_index(table_name, column_name, options = {}) == true
|
518
|
+
execute "CREATE #{index_type} INDEX #{quote_column_name(index_name)} ON #{quote_table_name(table_name)} (#{index_columns})"
|
519
|
+
end
|
520
|
+
end
|
521
|
+
|
522
|
+
def okay_index(table_name, column_name, options = {})
|
523
|
+
begin
|
524
|
+
execute("CREATE #{index_type} INDEX #{quote_column_name(index_name)} ON #{quote_table_name(table_name)} (#{index_columns})")
|
525
|
+
return true
|
526
|
+
rescue
|
527
|
+
return false
|
528
|
+
end
|
529
|
+
end
|
530
|
+
|
531
|
+
#Carlos Added Ends
|
532
|
+
|
510
533
|
def remove_index!(table_name, index_name) #:nodoc:
|
511
534
|
raise NotImplementedError, "remove_index! is not implemented"
|
512
535
|
end
|
@@ -515,6 +538,18 @@ module ActiveRecord
|
|
515
538
|
execute("ALTER INDEX #{quote_column_name(old_name)} RENAME TO #{quote_table_name(new_name)}")
|
516
539
|
end
|
517
540
|
|
541
|
+
#Carlos Added
|
542
|
+
def column_exists?(table_name, column_name, type = nil, options = {})
|
543
|
+
begin
|
544
|
+
execute("SELECT #{quote_column_name(column_name)} FROM #{quote_table_name(table_name)}")
|
545
|
+
return true
|
546
|
+
rescue
|
547
|
+
return false
|
548
|
+
end
|
549
|
+
end
|
550
|
+
|
551
|
+
#ENDS
|
552
|
+
|
518
553
|
def table_exists?(table_name)
|
519
554
|
return false unless table_name
|
520
555
|
|
@@ -546,7 +581,6 @@ module ActiveRecord
|
|
546
581
|
|
547
582
|
# Returns an array of indexes for the given table. Skip primary keys.
|
548
583
|
def indexes(table_name, name = nil)
|
549
|
-
|
550
584
|
# the following query returns something like this:
|
551
585
|
#
|
552
586
|
# INDEXNAME TABLENAME NON_UNIQUE FIELD LENGTH
|
@@ -578,7 +612,8 @@ module ActiveRecord
|
|
578
612
|
current_index = nil
|
579
613
|
result.map do |row|
|
580
614
|
row.symbolize_keys!
|
581
|
-
|
615
|
+
#Carlos Added .downcase!
|
616
|
+
index_name = row[:index_name].downcase!
|
582
617
|
if current_index != index_name
|
583
618
|
next if !!(/PRIMARY/ =~ index_name)
|
584
619
|
current_index = index_name
|
@@ -649,6 +684,7 @@ module ActiveRecord
|
|
649
684
|
# nuodb specific types...
|
650
685
|
:char => {:name => 'char'},
|
651
686
|
:numeric => {:name => 'numeric(20)'},
|
687
|
+
:binarystring => {:name => 'varchar', :limit => 255}
|
652
688
|
}
|
653
689
|
end
|
654
690
|
|
data/test/.DS_Store
ADDED
Binary file
|
data/test/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
/config.yml
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module ActiveRecord
|
2
|
+
module ConnectionHandling
|
3
|
+
def fake_connection(config)
|
4
|
+
ConnectionAdapters::FakeAdapter.new nil, logger
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
module ConnectionAdapters
|
9
|
+
class FakeAdapter < AbstractAdapter
|
10
|
+
attr_accessor :tables, :primary_keys
|
11
|
+
|
12
|
+
@columns = Hash.new { |h,k| h[k] = [] }
|
13
|
+
class << self
|
14
|
+
attr_reader :columns
|
15
|
+
end
|
16
|
+
|
17
|
+
def initialize(connection, logger)
|
18
|
+
super
|
19
|
+
@tables = []
|
20
|
+
@primary_keys = {}
|
21
|
+
@columns = self.class.columns
|
22
|
+
end
|
23
|
+
|
24
|
+
def primary_key(table)
|
25
|
+
@primary_keys[table]
|
26
|
+
end
|
27
|
+
|
28
|
+
def merge_column(table_name, name, sql_type = nil, options = {})
|
29
|
+
@columns[table_name] << ActiveRecord::ConnectionAdapters::Column.new(
|
30
|
+
name.to_s,
|
31
|
+
options[:default],
|
32
|
+
sql_type.to_s,
|
33
|
+
options[:null])
|
34
|
+
end
|
35
|
+
|
36
|
+
def columns(table_name)
|
37
|
+
@columns[table_name]
|
38
|
+
end
|
39
|
+
|
40
|
+
def active?
|
41
|
+
true
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|