activerecord-cockroachdb-adapter 8.0.2 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/CONTRIBUTING.md +10 -17
- data/Gemfile +2 -1
- data/Rakefile +0 -19
- data/lib/active_record/connection_adapters/cockroachdb/column.rb +66 -24
- data/lib/active_record/connection_adapters/cockroachdb/database_statements.rb +13 -3
- data/lib/active_record/connection_adapters/cockroachdb/database_tasks.rb +1 -1
- data/lib/active_record/connection_adapters/cockroachdb/oid/spatial.rb +34 -19
- data/lib/active_record/connection_adapters/cockroachdb/quoting.rb +19 -3
- data/lib/active_record/connection_adapters/cockroachdb/referential_integrity.rb +87 -55
- data/lib/active_record/connection_adapters/cockroachdb/schema_statements.rb +181 -102
- data/lib/active_record/connection_adapters/cockroachdb_adapter.rb +42 -25
- data/lib/version.rb +1 -1
- data/test/cases/adapter_test.rb +98 -0
- data/test/cases/adapters/cockroachdb/referential_integrity_test.rb +51 -0
- data/test/cases/adapters/postgresql/active_schema_test.rb +71 -0
- data/test/cases/adapters/postgresql/change_schema_test.rb +75 -0
- data/test/cases/adapters/postgresql/connection_test.rb +46 -0
- data/test/cases/adapters/postgresql/ddl_test.rb +326 -0
- data/test/cases/adapters/postgresql/interval_test.rb +131 -0
- data/test/cases/adapters/postgresql/nested_class_test.rb +22 -0
- data/test/cases/adapters/postgresql/numeric_test.rb +28 -0
- data/test/cases/adapters/postgresql/postgis_test.rb +185 -0
- data/test/cases/adapters/postgresql/postgresql_adapter_test.rb +115 -0
- data/test/cases/adapters/postgresql/quoting_test.rb +30 -0
- data/test/cases/adapters/postgresql/schema_statements_test.rb +29 -0
- data/test/cases/adapters/postgresql/serial_test.rb +199 -0
- data/test/cases/adapters/postgresql/spatial_queries_test.rb +118 -0
- data/test/cases/adapters/postgresql/spatial_setup_test.rb +18 -0
- data/test/cases/adapters/postgresql/spatial_type_test.rb +41 -0
- data/test/cases/adapters/postgresql/timestamp_test.rb +58 -0
- data/test/cases/adapters/postgresql/virtual_column_test.rb +39 -0
- data/test/cases/associations/eager_load_nested_include_test.rb +111 -0
- data/test/cases/associations/left_outer_join_association_test.rb +30 -0
- data/test/cases/associations_test.rb +108 -0
- data/test/cases/base_test.rb +31 -0
- data/test/cases/comment_test.rb +75 -0
- data/test/cases/connection_adapters/type_test.rb +28 -0
- data/test/cases/database_configurations/resolver_test.rb +24 -0
- data/test/cases/defaults_test.rb +45 -0
- data/test/cases/dirty_test.rb +24 -0
- data/test/cases/fixtures_test.rb +541 -0
- data/test/cases/helper_cockroachdb.rb +232 -0
- data/test/cases/inheritance_test.rb +42 -0
- data/test/cases/invertible_migration_test.rb +73 -0
- data/test/cases/marshal_serialization_test.rb +45 -0
- data/test/cases/migration/change_schema_test.rb +140 -0
- data/test/cases/migration/check_constraint_test.rb +125 -0
- data/test/cases/migration/columns_test.rb +50 -0
- data/test/cases/migration/create_join_table_test.rb +66 -0
- data/test/cases/migration/foreign_key_test.rb +390 -0
- data/test/cases/migration/hidden_column_test.rb +70 -0
- data/test/cases/migration/references_foreign_key_test.rb +124 -0
- data/test/cases/migration_test.rb +120 -0
- data/test/cases/persistence_test.rb +33 -0
- data/test/cases/primary_keys_test.rb +134 -0
- data/test/cases/relation/aost_test.rb +57 -0
- data/test/cases/relation/or_test.rb +26 -0
- data/test/cases/relation/table_hints_test.rb +124 -0
- data/test/cases/relation_test.rb +26 -0
- data/test/cases/relations_test.rb +29 -0
- data/test/cases/schema_dumper_test.rb +221 -0
- data/test/cases/show_create_test.rb +14 -0
- data/test/cases/strict_loading_test.rb +34 -0
- data/test/cases/tasks/cockroachdb_rake_test.rb +113 -0
- data/test/cases/test_fixtures_test.rb +57 -0
- data/test/cases/transactions_test.rb +51 -0
- data/test/cases/unsafe_raw_sql_test.rb +22 -0
- data/test/config.yml +23 -0
- data/test/excludes/ActiveRecord/AdapterTest.rb +3 -0
- data/test/excludes/ActiveRecord/AdapterTestWithoutTransaction.rb +25 -0
- data/test/excludes/ActiveRecord/ConnectionAdapters/PoolConfig/ResolverTest.rb +1 -0
- data/test/excludes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter/BindParameterTest.rb +15 -0
- data/test/excludes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter/QuotingTest.rb +22 -0
- data/test/excludes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapterPreventWritesLegacyTest.rb +1 -0
- data/test/excludes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapterPreventWritesTest.rb +1 -0
- data/test/excludes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapterTest.rb +40 -0
- data/test/excludes/ActiveRecord/ConnectionAdapters/RegistrationIsolatedTest.rb +14 -0
- data/test/excludes/ActiveRecord/Encryption/EncryptionPerformanceTest.rb +1 -0
- data/test/excludes/ActiveRecord/Encryption/EnvelopeEncryptionPerformanceTest.rb +1 -0
- data/test/excludes/ActiveRecord/Encryption/ExtendedDeterministicQueriesPerformanceTest.rb +1 -0
- data/test/excludes/ActiveRecord/Encryption/StoragePerformanceTest.rb +2 -0
- data/test/excludes/ActiveRecord/InstrumentationTest.rb +16 -0
- data/test/excludes/ActiveRecord/InvertibleMigrationTest.rb +2 -0
- data/test/excludes/ActiveRecord/Migration/ChangeSchemaTest.rb +7 -0
- data/test/excludes/ActiveRecord/Migration/CheckConstraintTest.rb +6 -0
- data/test/excludes/ActiveRecord/Migration/ColumnsTest.rb +4 -0
- data/test/excludes/ActiveRecord/Migration/CompatibilityTest.rb +50 -0
- data/test/excludes/ActiveRecord/Migration/CompositeForeignKeyTest.rb +2 -0
- data/test/excludes/ActiveRecord/Migration/CreateJoinTableTest.rb +2 -0
- data/test/excludes/ActiveRecord/Migration/ForeignKeyInCreateTest.rb +1 -0
- data/test/excludes/ActiveRecord/Migration/ForeignKeyTest.rb +35 -0
- data/test/excludes/ActiveRecord/Migration/InvalidOptionsTest.rb +14 -0
- data/test/excludes/ActiveRecord/Migration/PGChangeSchemaTest.rb +8 -0
- data/test/excludes/ActiveRecord/Migration/ReferencesForeignKeyTest.rb +7 -0
- data/test/excludes/ActiveRecord/Migration/ReferencesIndexTest.rb +7 -0
- data/test/excludes/ActiveRecord/Migration/ReferencesStatementsTest.rb +3 -0
- data/test/excludes/ActiveRecord/MysqlDBCreateWithInvalidPermissionsTest.rb +1 -0
- data/test/excludes/ActiveRecord/OrTest.rb +1 -0
- data/test/excludes/ActiveRecord/PostgreSQLStructureDumpTest.rb +10 -0
- data/test/excludes/ActiveRecord/PostgresqlConnectionTest.rb +12 -0
- data/test/excludes/ActiveRecord/PostgresqlTransactionNestedTest.rb +14 -0
- data/test/excludes/ActiveRecord/PostgresqlTransactionTest.rb +4 -0
- data/test/excludes/ActiveRecord/RelationTest.rb +2 -0
- data/test/excludes/ActiveRecord/TooManyOrTest.rb +1 -0
- data/test/excludes/ActiveSupportSubclassWithFixturesTest.rb +1 -0
- data/test/excludes/AssociationDeprecationTest/NotifyModeTest.rb +2 -0
- data/test/excludes/AssociationDeprecationTest/RaiseBacktraceModeTest.rb +2 -0
- data/test/excludes/AssociationDeprecationTest/RaiseModeTest.rb +2 -0
- data/test/excludes/AssociationDeprecationTest/WarnBacktraceModeTest.rb +2 -0
- data/test/excludes/AssociationDeprecationTest/WarnModeTest.rb +2 -0
- data/test/excludes/AssociationDeprecationTest/fix_backtrace_cleaner.rb +10 -0
- data/test/excludes/BasicsTest.rb +1 -0
- data/test/excludes/BulkAlterTableMigrationsTest.rb +7 -0
- data/test/excludes/CalculationsTest.rb +4 -0
- data/test/excludes/CommentTest.rb +2 -0
- data/test/excludes/CoreTest.rb +1 -0
- data/test/excludes/CreateOrFindByWithinTransactions.rb +3 -0
- data/test/excludes/DefaultsUsingMultipleSchemasAndDomainTest.rb +7 -0
- data/test/excludes/DirtyTest.rb +3 -0
- data/test/excludes/EachTest.rb +8 -0
- data/test/excludes/EagerLoadPolyAssocsTest.rb +1 -0
- data/test/excludes/ExplicitlyNamedIndexMigrationTest.rb +1 -0
- data/test/excludes/FixturesResetPkSequenceTest.rb +3 -0
- data/test/excludes/FixturesTest.rb +21 -0
- data/test/excludes/FixturesWithForeignKeyViolationsTest.rb +2 -0
- data/test/excludes/ForeignTableTest.rb +10 -0
- data/test/excludes/InheritanceComputeTypeTest.rb +1 -0
- data/test/excludes/LeftOuterJoinAssociationTest.rb +2 -0
- data/test/excludes/LegacyPrimaryKeyTest/V4_2.rb +6 -0
- data/test/excludes/LegacyPrimaryKeyTest/V5_0.rb +6 -0
- data/test/excludes/MarshalSerializationTest.rb +4 -0
- data/test/excludes/MaterializedViewTest.rb +13 -0
- data/test/excludes/MigrationTest.rb +2 -0
- data/test/excludes/MultiDbMigratorTest.rb +2 -0
- data/test/excludes/NestedRelationScopingTest.rb +1 -0
- data/test/excludes/OrTest.rb +1 -0
- data/test/excludes/PersistenceTest.rb +3 -0
- data/test/excludes/PessimisticLockingTest.rb +1 -0
- data/test/excludes/PostgreSQLExplainTest.rb +7 -0
- data/test/excludes/PostgreSQLGeometricLineTest.rb +3 -0
- data/test/excludes/PostgreSQLGeometricTypesTest.rb +7 -0
- data/test/excludes/PostgreSQLPartitionsTest.rb +1 -0
- data/test/excludes/PostgreSQLReferentialIntegrityTest.rb +14 -0
- data/test/excludes/PostgresqlArrayTest.rb +21 -0
- data/test/excludes/PostgresqlBigSerialTest.rb +7 -0
- data/test/excludes/PostgresqlBitStringTest.rb +2 -0
- data/test/excludes/PostgresqlByteaTest.rb +1 -0
- data/test/excludes/PostgresqlCitextTest.rb +7 -0
- data/test/excludes/PostgresqlCollationTest.rb +5 -0
- data/test/excludes/PostgresqlCompositeTest.rb +2 -0
- data/test/excludes/PostgresqlCompositeWithCustomOIDTest.rb +2 -0
- data/test/excludes/PostgresqlDataTypeTest.rb +9 -0
- data/test/excludes/PostgresqlDefaultExpressionTest.rb +1 -0
- data/test/excludes/PostgresqlDeferredConstraintsTest.rb +3 -0
- data/test/excludes/PostgresqlDomainTest.rb +2 -0
- data/test/excludes/PostgresqlExtensionMigrationTest.rb +5 -0
- data/test/excludes/PostgresqlFullTextTest.rb +3 -0
- data/test/excludes/PostgresqlGeometricTest.rb +4 -0
- data/test/excludes/PostgresqlHstoreTest.rb +45 -0
- data/test/excludes/PostgresqlInfinityTest.rb +5 -0
- data/test/excludes/PostgresqlIntervalTest.rb +1 -0
- data/test/excludes/PostgresqlJSONBTest.rb +27 -0
- data/test/excludes/PostgresqlJSONTest.rb +27 -0
- data/test/excludes/PostgresqlLtreeTest.rb +4 -0
- data/test/excludes/PostgresqlMoneyTest.rb +12 -0
- data/test/excludes/PostgresqlNetworkTest.rb +69 -0
- data/test/excludes/PostgresqlNumberTest.rb +1 -0
- data/test/excludes/PostgresqlPointTest.rb +15 -0
- data/test/excludes/PostgresqlRangeTest.rb +3 -0
- data/test/excludes/PostgresqlRenameTableTest.rb +2 -0
- data/test/excludes/PostgresqlSerialTest.rb +7 -0
- data/test/excludes/PostgresqlTimestampFixtureTest.rb +2 -0
- data/test/excludes/PostgresqlTimestampMigrationTest.rb +3 -0
- data/test/excludes/PostgresqlTypeLookupTest.rb +2 -0
- data/test/excludes/PostgresqlUUIDGenerationTest.rb +7 -0
- data/test/excludes/PostgresqlUUIDTest.rb +1 -0
- data/test/excludes/PostgresqlVirtualColumnTest.rb +17 -0
- data/test/excludes/PostgresqlXMLTest.rb +5 -0
- data/test/excludes/PrimaryKeyIntegerNilDefaultTest.rb +1 -0
- data/test/excludes/PrimaryKeyIntegerTest.rb +3 -0
- data/test/excludes/PrimaryKeysTest.rb +2 -0
- data/test/excludes/RelationMergingTest.rb +15 -0
- data/test/excludes/RelationTest.rb +3 -0
- data/test/excludes/ReservedWordsMigrationTest.rb +1 -0
- data/test/excludes/SameNameDifferentDatabaseFixturesTest.rb +1 -0
- data/test/excludes/SanitizeTest.rb +13 -0
- data/test/excludes/SchemaAuthorizationTest.rb +8 -0
- data/test/excludes/SchemaCreateTableOptionsTest.rb +2 -0
- data/test/excludes/SchemaDumperDefaultsTest.rb +1 -0
- data/test/excludes/SchemaDumperTest.rb +11 -0
- data/test/excludes/SchemaForeignKeyTest.rb +1 -0
- data/test/excludes/SchemaIndexNullsOrderTest.rb +2 -0
- data/test/excludes/SchemaIndexOpclassTest.rb +3 -0
- data/test/excludes/SchemaTest.rb +49 -0
- data/test/excludes/SequenceNameDetectionTestCases/CollidedSequenceNameTest.rb +1 -0
- data/test/excludes/SequenceNameDetectionTestCases/LongerSequenceNameDetectionTest.rb +1 -0
- data/test/excludes/StrictLoadingFixturesTest.rb +1 -0
- data/test/excludes/TestFixturesTest.rb +1 -0
- data/test/excludes/TransactionInstrumentationTest.rb +1 -0
- data/test/excludes/TransactionIsolationTest.rb +1 -0
- data/test/excludes/TypeTest.rb +1 -0
- data/test/excludes/UniquenessValidationTest.rb +2 -0
- data/test/excludes/UnloggedTablesTest.rb +3 -0
- data/test/excludes/UnsafeRawSqlTest.rb +2 -0
- data/test/excludes/UpdateableViewTest.rb +5 -0
- data/test/excludes/WithAnnotationsTest.rb +6 -0
- data/test/models/building.rb +4 -0
- data/test/models/spatial_model.rb +5 -0
- data/test/schema/cockroachdb_specific_schema.rb +218 -0
- data/test/support/copy_cat.rb +83 -0
- data/test/support/exclude_from_transactional_tests.rb +33 -0
- data/test/support/paths_cockroachdb.rb +46 -0
- data/test/support/rake_helpers.rb +37 -0
- data/test/support/sql_logger.rb +55 -0
- data/test/support/template_creator.rb +114 -0
- metadata +422 -34
- data/.editorconfig +0 -7
- data/.github/issue_template.md +0 -46
- data/.github/reproduction_scripts/migrations.rb +0 -60
- data/.github/reproduction_scripts/models_and_database.rb +0 -49
- data/.github/workflows/ci.yml +0 -96
- data/.github/workflows/docker.yml +0 -57
- data/.gitignore +0 -18
- data/.gitmodules +0 -0
- data/activerecord-cockroachdb-adapter.gemspec +0 -38
- data/bin/console +0 -36
- data/bin/console_schemas/default.rb +0 -11
- data/bin/console_schemas/schemas.rb +0 -23
- data/bin/setup +0 -8
- data/bin/start-cockroachdb +0 -33
- data/build/Dockerfile +0 -14
- data/build/config.teamcity.yml +0 -31
- data/build/local-test.sh +0 -32
- data/build/teamcity-test.sh +0 -76
- data/docker.sh +0 -35
- data/lib/active_record/connection_adapters/cockroachdb/spatial_column_info.rb +0 -60
- data/setup.sql +0 -18
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require "support/copy_cat"
|
|
2
|
+
|
|
3
|
+
# Remove hstore from setup (both the extension and the column).
|
|
4
|
+
CopyCat.copy_methods(self, self, :setup) do
|
|
5
|
+
def on_send(node)
|
|
6
|
+
if node in [:send, nil, :enable_extension!, [:str, "hstore"], *] | # enable_extension!("hstore", ...)
|
|
7
|
+
[:send, [:lvar, :t], :hstore, *] # t.hstore(...)
|
|
8
|
+
remove(node.location.expression)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
exclude :test_change_column_default_with_array, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
14
|
+
exclude :test_schema_dump_with_shorthand, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
15
|
+
exclude :test_change_column_from_non_array_to_array, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
16
|
+
exclude :test_with_multi_dimensional_empty_strings, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
17
|
+
exclude :test_mutate_value_in_array, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
18
|
+
exclude :test_change_column_with_array, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
19
|
+
exclude :test_multi_dimensional_with_integers, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
20
|
+
exclude :test_with_arbitrary_whitespace, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
21
|
+
exclude :test_multi_dimensional_with_strings, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Note: all these tests fail during setup trying to create a column with a
|
|
2
|
+
# sequence backed default because the sequence doesn't exist. The tests still
|
|
3
|
+
# fail for different reasons after the setup is fixed.
|
|
4
|
+
exclude :test_bigserial_column, "The test is valid but can't pass with the bad setup."
|
|
5
|
+
exclude :test_not_bigserial_column, "The serial? assertion fails because a bigint column with a serial default function is not distinguishable from a serial column. See https://www.cockroachlabs.com/docs/v19.2/serial.html#modes-of-operation."
|
|
6
|
+
exclude :test_schema_dump_with_shorthand, "The test is valid but can't pass with the bad setup."
|
|
7
|
+
exclude :test_schema_dump_with_not_bigserial, "If a bigint column is created with a serial default function, it will be treated like a serial column in CockroachDB."
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
exclude :test_default, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
2
|
+
exclude :test_schema_dumping, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exclude :test_via_to_sql_with_complicating_connection, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
exclude :test_select_case_insensitive, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
2
|
+
exclude :test_column, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
3
|
+
exclude :test_change_table_supports_json, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
4
|
+
exclude :test_write, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
5
|
+
exclude :test_citext_enabled, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
6
|
+
exclude :test_schema_dump_with_shorthand, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
7
|
+
exclude :test_case_insensitiveness, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
exclude :test_change_column_with_collation, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
2
|
+
exclude :test_schema_dump_includes_collation, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
3
|
+
exclude :test_add_column_with_collation, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
4
|
+
exclude :test_string_column_with_collation, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
5
|
+
exclude :test_text_column_with_collation, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
|
|
2
|
+
ago_msg = "'ago' is not supported in CRDB's interval parsing. Test ignored. See #340"
|
|
3
|
+
exclude :test_text_columns_are_limitless_the_upper_limit_is_one_GB, ago_msg
|
|
4
|
+
exclude :test_data_type_of_oid_types, ago_msg
|
|
5
|
+
exclude :test_update_oid, ago_msg
|
|
6
|
+
exclude :test_data_type_of_time_types, ago_msg
|
|
7
|
+
exclude :test_oid_values, ago_msg
|
|
8
|
+
exclude :test_time_values, ago_msg
|
|
9
|
+
exclude :test_update_large_time_in_seconds, ago_msg
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exclude :test_schema_dump_includes_default_expression, "The test fails because CockroachDB uses different functions than PostgreSQL for current date/timestamps. See https://www.cockroachlabs.com/docs/v19.2/functions-and-operators.html#date-and-time-functions."
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
exclude :test_column, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
2
|
+
exclude :test_domain_acts_like_basetype, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
exclude :test_disable_extension_migration_ignores_prefix_and_suffix, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
2
|
+
exclude :test_enable_extension_migration_ignores_prefix_and_suffix, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
3
|
+
exclude :test_disable_extension_drops_extension_when_cascading, ExcludeMessage::NO_HSTORE
|
|
4
|
+
exclude :test_disable_extension_raises_when_dependent_objects_exist, ExcludeMessage::NO_HSTORE
|
|
5
|
+
exclude :test_enable_extension_migration_with_schema, ExcludeMessage::NO_HSTORE
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
exclude :test_update_tsvector, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
2
|
+
exclude :test_schema_dump_with_shorthand, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
3
|
+
exclude :test_tsvector_column, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
exclude :test_geometric_types, "Geometric types are not supported in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/21286."
|
|
2
|
+
exclude :test_alternative_format, "Geometric types are not supported in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/21286."
|
|
3
|
+
exclude :test_geometric_function, "Geometric types are not supported in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/21286."
|
|
4
|
+
exclude :test_schema_dumping, "Geometric types are not supported in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/21286."
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
exclude :test_quotes, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
2
|
+
exclude :test_select_multikey, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
3
|
+
exclude :test_type_cast_hstore, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
4
|
+
exclude :test_cast_value_on_write, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
5
|
+
exclude :test_array_strings_with_quotes, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
6
|
+
exclude :test_quoting_special_characters, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
7
|
+
exclude :test_select, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
8
|
+
exclude :test_default, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
9
|
+
exclude :test_rewrite, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
10
|
+
exclude :test_array_strings_with_array_delimiters, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
11
|
+
exclude :test_changes_in_place, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
12
|
+
exclude :test_clone_hstore_with_serialized_attributes, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
13
|
+
exclude :test_supports_to_unsafe_h_values, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
14
|
+
exclude :test_with_store_accessors, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
15
|
+
exclude :test_array_strings_with_commas, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
16
|
+
exclude :test_comma, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
17
|
+
exclude :test_yaml_round_trip_with_store_accessors, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
18
|
+
exclude :test_hstore_included_in_extensions, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
19
|
+
exclude :test_array_strings_with_null_strings, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
20
|
+
exclude :test_hstore_migration, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
21
|
+
exclude :test_duplication_with_store_accessors, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
22
|
+
exclude :test_disable_enable_hstore, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
23
|
+
exclude :test_array_cycle, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
24
|
+
exclude :test_contains_nils, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
25
|
+
exclude :test_change_table_supports_hstore, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
26
|
+
exclude :test_create, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
27
|
+
exclude :test_hstore_with_serialized_attributes, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
28
|
+
exclude :test_column, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
29
|
+
exclude :test_parse5, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
30
|
+
exclude :test_parse6, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
31
|
+
exclude :test_multiline, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
32
|
+
exclude :test_nil, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
33
|
+
exclude :test_whitespace, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
34
|
+
exclude :test_parse7, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
35
|
+
exclude :test_arrow, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
36
|
+
exclude :test_backslash, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
37
|
+
exclude :test_schema_dump_with_shorthand, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
38
|
+
exclude :test_dirty_from_user_equal, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
39
|
+
exclude :test_hstore_dirty_from_database_equal, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
40
|
+
exclude :test_changes_with_store_accessors, ExcludeMessage::NO_HSTORE
|
|
41
|
+
exclude :test_various_null, ExcludeMessage::NO_HSTORE
|
|
42
|
+
exclude :test_spaces, ExcludeMessage::NO_HSTORE
|
|
43
|
+
exclude :test_signs, ExcludeMessage::NO_HSTORE
|
|
44
|
+
exclude :test_equal_signs, ExcludeMessage::NO_HSTORE
|
|
45
|
+
exclude :test_commas, ExcludeMessage::NO_HSTORE
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
exclude :test_type_casting_infinity_on_a_float_column, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
2
|
+
exclude :test_type_casting_infinity_on_a_datetime_column, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
3
|
+
exclude :test_update_all_with_infinity_on_a_float_column, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
4
|
+
exclude "test_assigning_'infinity'_on_a_datetime_column_with_TZ_aware_attributes", "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
5
|
+
exclude :test_update_all_with_infinity_on_a_datetime_column, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exclude :test_schema_dump_with_default_value, "We implement our own tests for intervals, since CockroachDB does not support Iso8601 IntervalStyle currently."
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
exclude :test_schema_dumping, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
2
|
+
exclude :test_assigning_string_literal, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
3
|
+
exclude :test_not_compatible_with_serialize_json, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
4
|
+
exclude :test_changes_in_place_ignores_key_order, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
5
|
+
exclude :test_deserialize_with_array, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
6
|
+
exclude :test_assigning_boolean, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
7
|
+
exclude :test_json_with_serialized_attributes, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
8
|
+
exclude :test_default, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
9
|
+
exclude :test_select_multikey, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
10
|
+
exclude :test_yaml_round_trip_with_store_accessors, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
11
|
+
exclude :test_duplication_with_store_accessors, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
12
|
+
exclude :test_select_array_json_value, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
13
|
+
exclude :test_select_nil_json_after_update, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
14
|
+
exclude :test_changes_in_place, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
15
|
+
exclude :test_null_json, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
16
|
+
exclude :test_change_table_supports_json, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
17
|
+
exclude :test_column, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
18
|
+
exclude :test_rewrite, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
19
|
+
exclude :test_select_nil_json_after_create, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
20
|
+
exclude :test_with_store_accessors, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
21
|
+
exclude :test_assigning_number, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
22
|
+
exclude :test_cast_value_on_write, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
23
|
+
exclude :test_select, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
24
|
+
exclude :test_changes_in_place_with_ruby_object, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
25
|
+
exclude :test_rewrite_array_json_value, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
26
|
+
exclude :test_type_cast_json, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
27
|
+
exclude :test_pretty_print, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
exclude :test_assigning_boolean, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
2
|
+
exclude :test_select, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
3
|
+
exclude :test_null_json, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
4
|
+
exclude :test_select_nil_json_after_update, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
5
|
+
exclude :test_duplication_with_store_accessors, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
6
|
+
exclude :test_rewrite_array_json_value, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
7
|
+
exclude :test_type_cast_json, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
8
|
+
exclude :test_cast_value_on_write, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
9
|
+
exclude :test_with_store_accessors, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
10
|
+
exclude :test_default, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
11
|
+
exclude :test_deserialize_with_array, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
12
|
+
exclude :test_schema_dumping, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
13
|
+
exclude :test_not_compatible_with_serialize_json, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
14
|
+
exclude :test_rewrite, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
15
|
+
exclude :test_select_multikey, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
16
|
+
exclude :test_yaml_round_trip_with_store_accessors, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
17
|
+
exclude :test_assigning_string_literal, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
18
|
+
exclude :test_change_table_supports_json, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
19
|
+
exclude :test_changes_in_place_ignores_key_order, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
20
|
+
exclude :test_assigning_number, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
21
|
+
exclude :test_changes_in_place, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
22
|
+
exclude :test_json_with_serialized_attributes, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
23
|
+
exclude :test_column, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
24
|
+
exclude :test_select_array_json_value, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
25
|
+
exclude :test_select_nil_json_after_create, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
26
|
+
exclude :test_changes_in_place_with_ruby_object, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
27
|
+
exclude :test_pretty_print, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
exclude :test_column, "CockroachDB does not currently support the 'ltree' type."
|
|
2
|
+
exclude :test_schema_dump_with_shorthand, "CockroachDB does not currently support the 'ltree' type."
|
|
3
|
+
exclude :test_write, "CockroachDB does not currently support the 'ltree' type."
|
|
4
|
+
exclude :test_select, "CockroachDB does not currently support the 'ltree' type."
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
exclude :test_column, "The money type is not implemented in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/41578."
|
|
2
|
+
exclude :test_default, "The money type is not implemented in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/41578."
|
|
3
|
+
exclude :test_money_values, "The money type is not implemented in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/41578."
|
|
4
|
+
exclude :test_money_type_cast, "The money type is not implemented in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/41578."
|
|
5
|
+
exclude :test_money_regex_backtracking, "The money type is not implemented in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/41578."
|
|
6
|
+
exclude :test_schema_dumping, "The money type is not implemented in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/41578."
|
|
7
|
+
exclude :test_create_and_update_money, "The money type is not implemented in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/41578."
|
|
8
|
+
exclude :test_update_all_with_money_string, "The money type is not implemented in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/41578."
|
|
9
|
+
exclude :test_update_all_with_money_big_decimal, "The money type is not implemented in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/41578."
|
|
10
|
+
exclude :test_update_all_with_money_numeric, "The money type is not implemented in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/41578."
|
|
11
|
+
exclude :test_sum_with_type_cast, "The money type is not implemented in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/41578."
|
|
12
|
+
exclude :test_pluck_with_type_cast, "The money type is not implemented in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/41578."
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "support/copy_cat"
|
|
4
|
+
|
|
5
|
+
raise "a new setup has been added" if get_callbacks(:setup).count > 1
|
|
6
|
+
|
|
7
|
+
reset_callbacks :setup
|
|
8
|
+
|
|
9
|
+
setup do
|
|
10
|
+
@connection = ActiveRecord::Base.lease_connection
|
|
11
|
+
@connection.create_table("postgresql_network_addresses", force: true) do |t|
|
|
12
|
+
t.inet "inet_address", default: "192.168.1.1"
|
|
13
|
+
# Unsupported types cidr and macaddr
|
|
14
|
+
# t.cidr "cidr_address", default: "192.168.1.0/24"
|
|
15
|
+
# t.macaddr "mac_address", default: "ff:ff:ff:ff:ff:ff"
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
exclude :test_cidr_column, "CockroachDB does not currently support the 'cidr' type."
|
|
20
|
+
exclude :test_cidr_change_prefix, "CockroachDB does not currently support the 'cidr' type."
|
|
21
|
+
exclude :test_macaddr_column, "CockroachDB does not currently support the 'macaddr' type."
|
|
22
|
+
exclude :test_mac_address_change_case_does_not_mark_dirty, "CockroachDB does not currently support the 'macaddr' type."
|
|
23
|
+
|
|
24
|
+
CopyCat.copy_methods(self, self, :test_schema_dump_with_shorthand) do
|
|
25
|
+
def on_send(node)
|
|
26
|
+
return unless node in [:send, nil, :assert_match,
|
|
27
|
+
[:regexp, [:str, /(cidr|mac)_address/], *],
|
|
28
|
+
*
|
|
29
|
+
]
|
|
30
|
+
remove(node.location.expression)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
CopyCat.copy_methods(self, self, :test_network_types, :test_invalid_network_address) do
|
|
35
|
+
def on_send(node)
|
|
36
|
+
case node
|
|
37
|
+
in [:send, [:const, nil, :PostgresqlNetworkAddress], /create|new/, [:hash, *pairs]]
|
|
38
|
+
|
|
39
|
+
pairs.each_with_index do |pair, i|
|
|
40
|
+
if pair in [:pair, [:sym, /(cidr|mac)_address/], *]
|
|
41
|
+
expr = pair.location.expression
|
|
42
|
+
large_expr = expr.resize(expr.size + 1)
|
|
43
|
+
expr = large_expr if large_expr.source.end_with?(",")
|
|
44
|
+
remove(expr)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
in [:send, [:lvar, :address], /(cidr|mac)_address/, *]
|
|
48
|
+
remove(node.location.expression)
|
|
49
|
+
in [:send, nil, /assert_(equal|nil)/, *list]
|
|
50
|
+
# Recursive search for cidr or mac in test assertions.
|
|
51
|
+
until list.empty?
|
|
52
|
+
el = list.shift
|
|
53
|
+
if el.respond_to?(:children)
|
|
54
|
+
list.concat(el.children)
|
|
55
|
+
else
|
|
56
|
+
if el.respond_to?(:to_s)
|
|
57
|
+
str = el.to_s.downcase
|
|
58
|
+
if str.include?("cidr") || str.include?("mac")
|
|
59
|
+
remove(node.location.expression)
|
|
60
|
+
break
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
else
|
|
66
|
+
# Nothing
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exclude :test_values, "This test fails for an unknown reason on 'assert_equal ::Float::INFINITY, second.double' because Infinity is being cast to 0.0. See #77 for more details"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
exclude :test_column, "Geometric types are not supported in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/21286."
|
|
2
|
+
exclude :test_default, "Geometric types are not supported in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/21286."
|
|
3
|
+
exclude :test_schema_dumping, "Geometric types are not supported in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/21286."
|
|
4
|
+
exclude :test_roundtrip, "Geometric types are not supported in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/21286."
|
|
5
|
+
exclude :test_mutation, "Geometric types are not supported in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/21286."
|
|
6
|
+
exclude :test_array_assignment, "Geometric types are not supported in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/21286."
|
|
7
|
+
exclude :test_string_assignment, "Geometric types are not supported in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/21286."
|
|
8
|
+
exclude :test_empty_string_assignment, "Geometric types are not supported in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/21286."
|
|
9
|
+
exclude :test_array_of_points_round_trip, "Geometric types are not supported in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/21286."
|
|
10
|
+
exclude :test_legacy_column, "Geometric types are not supported in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/21286."
|
|
11
|
+
exclude :test_legacy_default, "Geometric types are not supported in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/21286."
|
|
12
|
+
exclude :test_legacy_schema_dumping, "Geometric types are not supported in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/21286."
|
|
13
|
+
exclude :test_legacy_roundtrip, "Geometric types are not supported in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/21286."
|
|
14
|
+
exclude :test_legacy_mutation, "Geometric types are not supported in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/21286."
|
|
15
|
+
exclude :test_hash_assignment, "Geometric types are not supported in CockroachDB. See https://github.com/cockroachdb/cockroach/issues/21286."
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
exclude :test_renaming_a_table_also_renames_the_primary_key_index, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
2
|
+
exclude :test_renaming_a_table_also_renames_the_primary_key_sequence, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Note: all these tests fail during setup trying to create a column with a
|
|
2
|
+
# sequence backed default because the sequence doesn't exist. The tests still
|
|
3
|
+
# fail for different reasons after the setup is fixed.
|
|
4
|
+
exclude :test_serial_column, "The sql_type assertion fails because integer columns are bigints in CockroachDB. See https://www.cockroachlabs.com/docs/v19.2/int.html#names-and-aliases."
|
|
5
|
+
exclude :test_not_serial_column, "The sql_type assertion fails because integer columns are bigints in CockroachDB. See https://www.cockroachlabs.com/docs/v19.2/int.html#names-and-aliases. The serial? assertion fails because an integer column with a serial default function is not distinguishable from a serial column. See https://www.cockroachlabs.com/docs/v19.2/serial.html#modes-of-operation."
|
|
6
|
+
exclude :test_schema_dump_with_shorthand, "Serial columns are backed by integer columns, and integer columns are really bigints in CockroachDB. Therefore, the dump will include bigserial instead of serial columns. See https://www.cockroachlabs.com/docs/v19.2/serial.html#generated-values-for-mode-sql_sequence."
|
|
7
|
+
exclude :test_schema_dump_with_not_serial, "If an integer column is created with a serial default function, it will be treated like a serial column in CockroachDB."
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
exclude :test_load_infinity_and_beyond, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
2
|
+
exclude :test_bc_timestamp_leap_year, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
exclude :test_adds_column_as_timestamp, "We implement our own version due to tests referencing the Adapter object."
|
|
2
|
+
exclude :test_adds_column_as_timestamptz_if_datetime_type_changed, "We implement our own version due to tests referencing the Adapter object."
|
|
3
|
+
exclude :test_adds_column_as_custom_type, "We implement our own version due to tests referencing the Adapter object."
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
exclude :test_array_delimiters_are_looked_up_correctly, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
2
|
+
exclude :test_range_types_correctly_respect_registration_of_subtypes, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
exclude :test_auto_create_uuid, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
2
|
+
exclude :test_id_is_uuid, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
3
|
+
exclude :test_schema_dumper_for_uuid_primary_key_default_in_legacy_migration, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
4
|
+
exclude :test_id_has_a_default, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
5
|
+
exclude :test_schema_dumper_for_uuid_primary_key, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
6
|
+
exclude :test_schema_dumper_for_uuid_primary_key_with_custom_default, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
7
|
+
exclude :test_schema_dumper_for_uuid_primary_key_default, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exclude :test_change_column_default, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require "support/copy_cat"
|
|
2
|
+
|
|
3
|
+
exclude :test_build_fixture_sql, "Skipping because CockroachDB cannot write directly to computed columns."
|
|
4
|
+
exclude :test_schema_dumping, "Replaced with local version"
|
|
5
|
+
|
|
6
|
+
# CRDB doesn't support implicit casts.
|
|
7
|
+
# See https://github.com/cockroachdb/cockroach/issues/75101
|
|
8
|
+
#
|
|
9
|
+
# From: "ASCII(name)"
|
|
10
|
+
# To: "ASCII(name)""::string"
|
|
11
|
+
CopyCat.copy_methods(self, self, :test_change_table_without_stored_option) do
|
|
12
|
+
def on_str(node)
|
|
13
|
+
return unless node in [:str, "ASCII(name)"]
|
|
14
|
+
|
|
15
|
+
insert_after(node.loc.expression, '"::string"')
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
exclude :test_round_trip, "CockroachDB does not currently support the 'xml' type."
|
|
2
|
+
exclude :test_null_xml, "CockroachDB does not currently support the 'xml' type."
|
|
3
|
+
exclude :test_update_all, "CockroachDB does not currently support the 'xml' type."
|
|
4
|
+
exclude :test_column, "CockroachDB does not currently support the 'xml' type."
|
|
5
|
+
exclude :test_schema_dump_with_shorthand, "CockroachDB does not currently support the 'xml' type."
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exclude "test_schema_dump_primary_key_integer_with_default_nil", "The test fails because CockroachDB's INT type translates to PostgreSQL's bigint type. Although the test table is created with an integer primary key, it will come back as BIGINT from CockroachDB. See https://www.cockroachlabs.com/docs/v19.2/int.html#names-and-aliases and https://www.postgresql.org/docs/current/datatype-numeric.htmli."
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
exclude "test_primary_key_column_type_with_serial/integer", "The last assertion in the test fails because CockroachDB's INT type translates to PostgreSQL's bigint type. See https://www.cockroachlabs.com/docs/v19.2/int.html#names-and-aliases and https://www.postgresql.org/docs/current/datatype-numeric.htmli."
|
|
2
|
+
exclude "test_schema_dump_primary_key_with_serial/integer", "The test creates a table with a serial primary key, but the schema dump assertion fails because serial columns are bigserial columns in CockroachDB. ActiveRecord schema dumps only include serial info if the primary key is a serial column. The serial info is excluded otherwise because Active Record will create primary keys as bigserial by default. See https://www.cockroachlabs.com/docs/v19.2/serial.html#generated-values-for-mode-sql_sequence, https://www.cockroachlabs.com/docs/v19.2/int.html#names-and-aliases, and https://github.com/rails/rails/pull/26266."
|
|
3
|
+
exclude "test_primary_key_with_serial/integer_are_automatically_numbered", "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
exclude :test_serial_with_quoted_sequence_name, "The serial? predicate assertion is valid, but the default_function is different in CockroachDB. See https://www.cockroachlabs.com/docs/v19.2/serial.html#modes-of-operation."
|
|
2
|
+
exclude :test_serial_with_unquoted_sequence_name, "The serial? predicate assertion is valid, but the default_function is different in CockroachDB. See https://www.cockroachlabs.com/docs/v19.2/serial.html#modes-of-operation."
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require "support/copy_cat"
|
|
2
|
+
|
|
3
|
+
# Quoting integer.
|
|
4
|
+
CopyCat.copy_methods(self, self, :test_relation_to_sql) do
|
|
5
|
+
# From: /.?post_id.? = #{post.id}\z/i
|
|
6
|
+
# To: /.?post_id.? = '#{post.id}'\z/i
|
|
7
|
+
def on_regexp(node)
|
|
8
|
+
# Sanity Check
|
|
9
|
+
return unless node in [:regexp, [:str, /post_id/], [:begin, [:send, [:lvar, :post], :id]], *]
|
|
10
|
+
|
|
11
|
+
first_str, _interpolation, last_str, _regopt = node.children
|
|
12
|
+
insert_after(first_str.loc.expression, ?')
|
|
13
|
+
insert_before(last_str.loc.expression, ?')
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
exclude :test_finding_with_sanitized_order, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
2
|
+
exclude :test_finding_with_subquery_with_eager_loading_in_from, "Overridden because test depends on ordering of results."
|
|
3
|
+
exclude :test_finding_with_arel_sql_order, "Result is quoted in CockroachDB."
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exclude :test_drop_index_from_table_named_values, "This isn't supported by CockroachDB; see https://www.cockroachlabs.com/docs/stable/online-schema-changes.html#examples-of-statements-that-fail for more information"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exclude :test_fixtures_are_properly_loaded, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
exclude :test_bind_enumerable, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
2
|
+
exclude :test_named_bind_variables, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
3
|
+
exclude :test_sanitize_sql_array_handles_named_bind_variables, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
4
|
+
|
|
5
|
+
require "support/copy_cat"
|
|
6
|
+
|
|
7
|
+
# CRDB quotes ranges, like Trilogy.
|
|
8
|
+
CopyCat.copy_methods(self, self, :test_bind_range) do
|
|
9
|
+
def on_sym(node)
|
|
10
|
+
return unless node in [:sym, :TrilogyAdapter]
|
|
11
|
+
replace(node.loc.expression, ":CockroachDBAdapter")
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
message = 'CockroachDB does not support variable session authorization. ' \
|
|
2
|
+
'See https://github.com/cockroachdb/cockroach/issues/40283'
|
|
3
|
+
exclude :test_sequence_schema_caching, message
|
|
4
|
+
exclude :test_session_auth=, message
|
|
5
|
+
exclude :test_schema_invisible, message
|
|
6
|
+
exclude :test_tables_in_current_schemas, message
|
|
7
|
+
exclude :test_auth_with_bind, message
|
|
8
|
+
exclude :test_setting_auth_clears_stmt_cache, message
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exclude :test_schema_dump_with_column_infinity_default, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
exclude :test_schema_dump_allows_array_of_decimal_defaults, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
2
|
+
exclude :test_foreign_keys_are_dumped_at_the_bottom_to_circumvent_dependency_issues, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
3
|
+
exclude :test_schema_dump_interval_type, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
4
|
+
exclude :test_do_not_dump_foreign_keys_for_ignored_tables, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
5
|
+
exclude :test_schema_dump_includes_bigint_default, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
|
|
6
|
+
exclude :test_schema_dump_with_timestamptz_datetime_format, "Re-implementing ourselves because we need CockroachDB specific methods."
|
|
7
|
+
exclude :test_schema_dump_with_correct_timestamp_types_via_add_column_with_type_as_string, "Re-implementing ourselves because we need CockroachDB specific methods."
|
|
8
|
+
exclude :test_timestamps_schema_dump_before_rails_7_with_timestamptz_setting, "Re-implementing ourselves because we need CockroachDB specific methods."
|
|
9
|
+
exclude :test_schema_dump_with_correct_timestamp_types_via_add_column_before_rails_7_with_timestamptz_setting, "Re-implementing ourselves because we need CockroachDB specific methods."
|
|
10
|
+
exclude :test_schema_dump_when_changing_datetime_type_for_an_existing_app, "Re-implementing ourselves because we need CockroachDB specific methods."
|
|
11
|
+
exclude :test_schema_dumps_check_constraints, "Re-implementing because some constraints are now written in parenthesis"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exclude :test_dump_foreign_key_targeting_different_schema, ExcludeMessage::VALIDATE_BUG
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
exclude :test_nulls_order_is_dumped, "NULLS FIRST/LAST are not included in the dump because they don't exist in CockroachDB. See https://www.cockroachlabs.com/docs/v19.2/null-handling.html#nulls-and-sorting."
|
|
2
|
+
exclude :test_non_default_order_with_nulls_is_dumped, "NULLS FIRST/LAST are not included in the dump because they don't exist in CockroachDB. See https://www.cockroachlabs.com/docs/v19.2/null-handling.html#nulls-and-sorting."
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
exclude :test_string_opclass_is_dumped, "Operator classes on indexes are not supported in CockroachDB."
|
|
2
|
+
exclude :test_non_default_opclass_is_dumped, "Operator classes on indexes are not supported in CockroachDB."
|
|
3
|
+
exclude :test_opclass_class_parsing_on_non_reserved_and_cannot_be_function_or_type_keyword, "Operator classes on indexes are not supported in CockroachDB."
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# This hack allows us to redefine the
|
|
2
|
+
# setup. We are using various weird
|
|
3
|
+
# routes that might be simplified:
|
|
4
|
+
# 1. We use `Ext` to prepend to the
|
|
5
|
+
# current class to be sure `#setup`
|
|
6
|
+
# is overriden.
|
|
7
|
+
# 2. Current is a reference to self to
|
|
8
|
+
# access it in `Ext`
|
|
9
|
+
# 3. const_missing is used to avoid
|
|
10
|
+
# having to rewrite every constant.
|
|
11
|
+
Current = self
|
|
12
|
+
module Ext
|
|
13
|
+
def self.const_missing(const)
|
|
14
|
+
Current.const_get(const)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def setup
|
|
18
|
+
@connection = ActiveRecord::Base.lease_connection
|
|
19
|
+
@connection.execute "SET default_int_size = 4"
|
|
20
|
+
@connection.execute "SET serial_normalization = sql_sequence_cached"
|
|
21
|
+
@connection.execute "CREATE SCHEMA #{SCHEMA_NAME}"
|
|
22
|
+
@connection.execute "CREATE TABLE #{SCHEMA_NAME}.#{TABLE_NAME} (#{COLUMNS.join(',')})"
|
|
23
|
+
@connection.execute "CREATE TABLE #{SCHEMA_NAME}.\"#{TABLE_NAME}.table\" (#{COLUMNS.join(',')})"
|
|
24
|
+
@connection.execute "CREATE TABLE #{SCHEMA_NAME}.\"#{CAPITALIZED_TABLE_NAME}\" (#{COLUMNS.join(',')})"
|
|
25
|
+
@connection.execute "CREATE SCHEMA #{SCHEMA2_NAME}"
|
|
26
|
+
@connection.execute "CREATE TABLE #{SCHEMA2_NAME}.#{TABLE_NAME} (#{COLUMNS.join(',')})"
|
|
27
|
+
@connection.execute "CREATE INDEX #{INDEX_A_NAME} ON #{SCHEMA_NAME}.#{TABLE_NAME} USING btree (#{INDEX_A_COLUMN});"
|
|
28
|
+
@connection.execute "CREATE INDEX #{INDEX_A_NAME} ON #{SCHEMA2_NAME}.#{TABLE_NAME} USING btree (#{INDEX_A_COLUMN});"
|
|
29
|
+
@connection.execute "CREATE INDEX #{INDEX_B_NAME} ON #{SCHEMA_NAME}.#{TABLE_NAME} USING btree (#{INDEX_B_COLUMN_S1});"
|
|
30
|
+
@connection.execute "CREATE INDEX #{INDEX_B_NAME} ON #{SCHEMA2_NAME}.#{TABLE_NAME} USING btree (#{INDEX_B_COLUMN_S2});"
|
|
31
|
+
@connection.execute "CREATE INDEX #{INDEX_C_NAME} ON #{SCHEMA_NAME}.#{TABLE_NAME} USING gin (#{INDEX_C_COLUMN});"
|
|
32
|
+
@connection.execute "CREATE INDEX #{INDEX_C_NAME} ON #{SCHEMA2_NAME}.#{TABLE_NAME} USING gin (#{INDEX_C_COLUMN});"
|
|
33
|
+
@connection.execute "CREATE INDEX #{INDEX_D_NAME} ON #{SCHEMA_NAME}.#{TABLE_NAME} USING btree (#{INDEX_D_COLUMN} DESC);"
|
|
34
|
+
@connection.execute "CREATE INDEX #{INDEX_D_NAME} ON #{SCHEMA2_NAME}.#{TABLE_NAME} USING btree (#{INDEX_D_COLUMN} DESC);"
|
|
35
|
+
@connection.execute "CREATE INDEX #{INDEX_E_NAME} ON #{SCHEMA_NAME}.#{TABLE_NAME} USING gin (#{INDEX_E_COLUMN});"
|
|
36
|
+
@connection.execute "CREATE INDEX #{INDEX_E_NAME} ON #{SCHEMA2_NAME}.#{TABLE_NAME} USING gin (#{INDEX_E_COLUMN});"
|
|
37
|
+
@connection.execute "CREATE TABLE #{SCHEMA_NAME}.#{PK_TABLE_NAME} (id serial primary key)"
|
|
38
|
+
@connection.execute "CREATE TABLE #{SCHEMA2_NAME}.#{PK_TABLE_NAME} (id serial primary key)"
|
|
39
|
+
@connection.execute "CREATE SEQUENCE #{SCHEMA_NAME}.#{UNMATCHED_SEQUENCE_NAME}"
|
|
40
|
+
@connection.execute "CREATE TABLE #{SCHEMA_NAME}.#{UNMATCHED_PK_TABLE_NAME} (id integer NOT NULL DEFAULT nextval('#{SCHEMA_NAME}.#{UNMATCHED_SEQUENCE_NAME}'::regclass), CONSTRAINT unmatched_pkey PRIMARY KEY (id))"
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def teardown
|
|
44
|
+
@connection.execute "SET default_int_size = DEFAULT"
|
|
45
|
+
@connection.execute "SET serial_normalization = DEFAULT"
|
|
46
|
+
super
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
prepend Ext
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exclude :test_schema_dump_with_collided_sequence_name, "Serial columns are dumped as a bigserials against CockroachDB. This happens because serial columns are backed by integers, and integers are really bigints in CockroachDB. See https://www.cockroachlabs.com/docs/v19.2/serial.html#generated-values-for-mode-sql_sequence."
|