test: migration
This commit is contained in:
35
test/migration.ts
Normal file
35
test/migration.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { TableMigration, BaseMigration } from "../auto/migration ";
|
||||
|
||||
import { nocoApi, toNocoApi } from "./auto-common";
|
||||
|
||||
const toBaseId = 'pjc9ks10ttrv6vz';
|
||||
|
||||
const baseId = 'p0np8adsoc79odk';
|
||||
|
||||
const tableId = 'mgt91mysuwts4e6';
|
||||
|
||||
async function migrateTable() {
|
||||
const tableMigration = new TableMigration({
|
||||
fromTableId: tableId,
|
||||
fromNoco: nocoApi,
|
||||
toNoco: toNocoApi,
|
||||
toBaseId,
|
||||
});
|
||||
await tableMigration.migrate();
|
||||
}
|
||||
|
||||
// await migrateTable();
|
||||
|
||||
async function mirgtateBase() {
|
||||
const baseMigration = new BaseMigration({
|
||||
fromBaseId: baseId,
|
||||
toBaseId,
|
||||
fromNoco: nocoApi,
|
||||
toNoco: toNocoApi,
|
||||
});
|
||||
await baseMigration.migrate({
|
||||
excludeTables: ['控制中枢', '人生备忘录'],
|
||||
// includeTables: ['人生备忘录']
|
||||
});
|
||||
}
|
||||
mirgtateBase();
|
||||
Reference in New Issue
Block a user