summaryrefslogtreecommitdiff
path: root/packages/db/test/unit/reference-queries.test.js
diff options
context:
space:
mode:
authorGravatar Ben Holmes <hey@bholmes.dev> 2024-03-27 15:51:26 -0400
committerGravatar GitHub <noreply@github.com> 2024-03-27 15:51:26 -0400
commit713abb2998bc179443a476f6274432b2fc7d8434 (patch)
tree7f2684367867068cef673d973aef16029f30935f /packages/db/test/unit/reference-queries.test.js
parent06a6c1a567513a40085c2fe59523dc66d809e1f2 (diff)
downloadastro-713abb2998bc179443a476f6274432b2fc7d8434.tar.gz
astro-713abb2998bc179443a476f6274432b2fc7d8434.tar.zst
astro-713abb2998bc179443a476f6274432b2fc7d8434.zip
chore(db): Rename all collection usage to tables (#10460)
* chore: rename `collection` field to `table` * chore: remove deprecated ResolvedCollectionConfig type (only used by studio) * chore: collection -> table in migration-queries * chore: update tests * chore: last renames * chore: bump migration version * chore: remove deprecated collection field * chore: droptablequeries * chore(test): collection -> tables * chore: revert collection -> table change on migration file * chore: revert migration version change * chore: changeset
Diffstat (limited to 'packages/db/test/unit/reference-queries.test.js')
-rw-r--r--packages/db/test/unit/reference-queries.test.js22
1 files changed, 6 insertions, 16 deletions
diff --git a/packages/db/test/unit/reference-queries.test.js b/packages/db/test/unit/reference-queries.test.js
index 49d816f73..2321ef507 100644
--- a/packages/db/test/unit/reference-queries.test.js
+++ b/packages/db/test/unit/reference-queries.test.js
@@ -1,6 +1,6 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
-import { getCollectionChangeQueries } from '../../dist/core/cli/migration-queries.js';
+import { getTableChangeQueries } from '../../dist/core/cli/migration-queries.js';
import { tablesSchema } from '../../dist/core/schemas.js';
import { column, defineTable } from '../../dist/runtime/config.js';
@@ -23,11 +23,6 @@ const BaseSentBox = defineTable({
},
});
-const defaultAmbiguityResponses = {
- collectionRenames: {},
- columnRenames: {},
-};
-
/**
* @typedef {import('../../dist/core/types.js').DBTable} DBTable
* @param {{ User: DBTable, SentBox: DBTable }} params
@@ -42,16 +37,11 @@ function resolveReferences(
return tablesSchema.parse({ User, SentBox });
}
-function userChangeQueries(
- oldCollection,
- newCollection,
- ambiguityResponses = defaultAmbiguityResponses
-) {
- return getCollectionChangeQueries({
- collectionName: 'User',
- oldCollection,
- newCollection,
- ambiguityResponses,
+function userChangeQueries(oldTable, newTable) {
+ return getTableChangeQueries({
+ tableName: 'User',
+ oldTable,
+ newTable,
});
}