mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-15 09:11:21 +10:00
feat(client cap): client capability framework + peer API configuration
This commit is contained in:
@ -0,0 +1,14 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- The values [DownloadAggregation] on the enum `ClientCapabilities` will be removed. If these variants are still used in the database, this will fail.
|
||||
|
||||
*/
|
||||
-- AlterEnum
|
||||
BEGIN;
|
||||
CREATE TYPE "ClientCapabilities_new" AS ENUM ('PeerAPI', 'UserStatus');
|
||||
ALTER TABLE "Client" ALTER COLUMN "capabilities" TYPE "ClientCapabilities_new"[] USING ("capabilities"::text::"ClientCapabilities_new"[]);
|
||||
ALTER TYPE "ClientCapabilities" RENAME TO "ClientCapabilities_old";
|
||||
ALTER TYPE "ClientCapabilities_new" RENAME TO "ClientCapabilities";
|
||||
DROP TYPE "ClientCapabilities_old";
|
||||
COMMIT;
|
||||
@ -0,0 +1,14 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- The values [PeerAPI,UserStatus] on the enum `ClientCapabilities` will be removed. If these variants are still used in the database, this will fail.
|
||||
|
||||
*/
|
||||
-- AlterEnum
|
||||
BEGIN;
|
||||
CREATE TYPE "ClientCapabilities_new" AS ENUM ('peerAPI', 'userStatus');
|
||||
ALTER TABLE "Client" ALTER COLUMN "capabilities" TYPE "ClientCapabilities_new"[] USING ("capabilities"::text::"ClientCapabilities_new"[]);
|
||||
ALTER TYPE "ClientCapabilities" RENAME TO "ClientCapabilities_old";
|
||||
ALTER TYPE "ClientCapabilities_new" RENAME TO "ClientCapabilities";
|
||||
DROP TYPE "ClientCapabilities_old";
|
||||
COMMIT;
|
||||
@ -0,0 +1,23 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `endpoint` on the `Client` table. All the data in the column will be lost.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "Client" DROP COLUMN "endpoint";
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "ClientPeerAPIConfiguration" (
|
||||
"id" TEXT NOT NULL,
|
||||
"clientId" TEXT NOT NULL,
|
||||
"ipConfigurations" TEXT[],
|
||||
|
||||
CONSTRAINT "ClientPeerAPIConfiguration_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "ClientPeerAPIConfiguration_clientId_key" ON "ClientPeerAPIConfiguration"("clientId");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "ClientPeerAPIConfiguration" ADD CONSTRAINT "ClientPeerAPIConfiguration_clientId_fkey" FOREIGN KEY ("clientId") REFERENCES "Client"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
@ -0,0 +1,9 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `ipConfigurations` on the `ClientPeerAPIConfiguration` table. All the data in the column will be lost.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "ClientPeerAPIConfiguration" DROP COLUMN "ipConfigurations",
|
||||
ADD COLUMN "endpoints" TEXT[];
|
||||
Reference in New Issue
Block a user