Files
AFFiNE-Mirror/packages/backend/server/migrations/20260102181003_cleanup_table/migration.sql
DarkSky 3633c75c6f feat: cleanup tables (#14203)
#### PR Dependency Tree


* **PR #14203** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Removed deprecated database tables, enums and schema fields (cleanup
of legacy subscription, invoice, runtime settings and session expiry
data). This includes irreversible data removal for those legacy
elements.
* **Tests**
* Updated tests and test data to align with the cleaned-up schema and
removed fields.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-03 03:50:14 +08:00

39 lines
1.4 KiB
SQL

/*
Warnings:
- You are about to drop the column `expires_at` on the `multiple_users_sessions` table. All the data in the column will be lost.
- You are about to drop the column `seq` on the `snapshots` table. All the data in the column will be lost.
- You are about to drop the column `seq` on the `updates` table. All the data in the column will be lost.
- You are about to drop the column `accepted` on the `workspace_user_permissions` table. All the data in the column will be lost.
- You are about to drop the `app_runtime_settings` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `user_invoices` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `user_subscriptions` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE "app_runtime_settings" DROP CONSTRAINT "app_runtime_settings_last_updated_by_fkey";
-- AlterTable
ALTER TABLE "multiple_users_sessions" DROP COLUMN "expires_at";
-- AlterTable
ALTER TABLE "snapshots" DROP COLUMN "seq";
-- AlterTable
ALTER TABLE "updates" DROP COLUMN "seq";
-- AlterTable
ALTER TABLE "workspace_user_permissions" DROP COLUMN "accepted";
-- DropTable
DROP TABLE "app_runtime_settings";
-- DropTable
DROP TABLE "user_invoices";
-- DropTable
DROP TABLE "user_subscriptions";
-- DropEnum
DROP TYPE "RuntimeConfigType";