Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
085abdd
progress
flipvh Oct 22, 2025
35484d6
Merge remote-tracking branch 'origin/development' into refactor/membe…
flipvh Oct 29, 2025
7403bb3
progress
flipvh Oct 30, 2025
9c0f632
more progress
flipvh Oct 30, 2025
ad7d9c2
fixes
flipvh Oct 30, 2025
e4aeb3c
chore: enable hook
LemonardoD Oct 30, 2025
0c720ac
chore: organize imports
LemonardoD Oct 30, 2025
79912e6
Merge branch 'development' of https://github.com/cellajs/cella into r…
LemonardoD Oct 30, 2025
d081200
chore: add todo
LemonardoD Oct 30, 2025
15d54d0
chore: fix pending memberships count
LemonardoD Oct 30, 2025
f0fb5e2
updates
flipvh Oct 30, 2025
9c4879c
fixes
flipvh Oct 30, 2025
dd832f2
tuning
flipvh Oct 30, 2025
8fcd02e
fixes
flipvh Oct 30, 2025
7996420
cleanup
flipvh Oct 30, 2025
0ddaf99
css cleaning
flipvh Oct 30, 2025
b07c503
tuning
flipvh Oct 31, 2025
e720bea
chore: make self invite direct
LemonardoD Oct 31, 2025
7aef89f
chore: add replaceSignedSrcs
LemonardoD Oct 31, 2025
5bbd09a
chore: fix todos
LemonardoD Oct 31, 2025
b6747b2
chore: fix membership rejection
LemonardoD Oct 31, 2025
538c2a8
chore: fix mockFetchRequest
LemonardoD Oct 31, 2025
92e2875
chore: fix types
LemonardoD Oct 31, 2025
1f08057
add todo
LemonardoD Oct 31, 2025
04a93d9
chore: update @hey-api/openapi-ts ver
LemonardoD Oct 31, 2025
7925c6e
chore: fix imports & enable lefthook
LemonardoD Oct 31, 2025
b4ab6e4
chore: todo
LemonardoD Oct 31, 2025
3a2aece
chore: todo
LemonardoD Oct 31, 2025
03eaa80
chore fix: handleOAuthInitiation flow
LemonardoD Oct 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,24 @@ CREATE TABLE "emails" (
CONSTRAINT "emails_email_unique" UNIQUE("email")
);
--> statement-breakpoint
CREATE TABLE "inactive_memberships" (
"created_at" timestamp DEFAULT now() NOT NULL,
"id" varchar PRIMARY KEY NOT NULL,
"context_type" varchar NOT NULL,
"user_id" varchar,
"role" varchar DEFAULT 'member' NOT NULL,
"rejected_at" timestamp,
"created_by" varchar NOT NULL,
"organization_id" varchar NOT NULL
);
--> statement-breakpoint
CREATE TABLE "memberships" (
"created_at" timestamp DEFAULT now() NOT NULL,
"id" varchar PRIMARY KEY NOT NULL,
"context_type" varchar NOT NULL,
"user_id" varchar NOT NULL,
"role" varchar DEFAULT 'member' NOT NULL,
"token_id" varchar,
"activated_at" timestamp,
"created_by" varchar,
"created_by" varchar NOT NULL,
"modified_at" timestamp,
"modified_by" varchar,
"archived" boolean DEFAULT false NOT NULL,
Expand Down Expand Up @@ -140,14 +149,12 @@ CREATE TABLE "tokens" (
"single_use_token" varchar,
"type" varchar NOT NULL,
"email" varchar NOT NULL,
"entity_type" varchar,
"role" varchar,
"user_id" varchar,
"oauth_account_id" varchar,
"inactive_membership_id" varchar,
"created_by" varchar,
"expires_at" timestamp with time zone NOT NULL,
"invoked_at" timestamp with time zone,
"organization_id" varchar
"invoked_at" timestamp with time zone
);
--> statement-breakpoint
CREATE TABLE "totps" (
Expand Down Expand Up @@ -197,8 +204,10 @@ ALTER TABLE "attachments" ADD CONSTRAINT "attachments_modified_by_users_id_fk" F
ALTER TABLE "attachments" ADD CONSTRAINT "attachments_organization_id_organizations_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organizations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "emails" ADD CONSTRAINT "emails_token_id_tokens_id_fk" FOREIGN KEY ("token_id") REFERENCES "public"."tokens"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "emails" ADD CONSTRAINT "emails_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "inactive_memberships" ADD CONSTRAINT "inactive_memberships_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "inactive_memberships" ADD CONSTRAINT "inactive_memberships_created_by_users_id_fk" FOREIGN KEY ("created_by") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "inactive_memberships" ADD CONSTRAINT "inactive_memberships_organization_id_organizations_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organizations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "memberships" ADD CONSTRAINT "memberships_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "memberships" ADD CONSTRAINT "memberships_token_id_tokens_id_fk" FOREIGN KEY ("token_id") REFERENCES "public"."tokens"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "memberships" ADD CONSTRAINT "memberships_created_by_users_id_fk" FOREIGN KEY ("created_by") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "memberships" ADD CONSTRAINT "memberships_modified_by_users_id_fk" FOREIGN KEY ("modified_by") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "memberships" ADD CONSTRAINT "memberships_organization_id_organizations_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organizations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
Expand All @@ -210,9 +219,9 @@ ALTER TABLE "passwords" ADD CONSTRAINT "passwords_user_id_users_id_fk" FOREIGN K
ALTER TABLE "requests" ADD CONSTRAINT "requests_token_id_tokens_id_fk" FOREIGN KEY ("token_id") REFERENCES "public"."tokens"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "sessions" ADD CONSTRAINT "sessions_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "tokens" ADD CONSTRAINT "tokens_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "tokens" ADD CONSTRAINT "tokens_oauth_account_id_oauth_accounts_id_fk" FOREIGN KEY ("oauth_account_id") REFERENCES "public"."oauth_accounts"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "tokens" ADD CONSTRAINT "tokens_created_by_users_id_fk" FOREIGN KEY ("created_by") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "tokens" ADD CONSTRAINT "tokens_organization_id_organizations_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organizations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "tokens" ADD CONSTRAINT "tokens_oauth_account_id_oauth_accounts_id_fk" FOREIGN KEY ("oauth_account_id") REFERENCES "public"."oauth_accounts"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "tokens" ADD CONSTRAINT "tokens_inactive_membership_id_inactive_memberships_id_fk" FOREIGN KEY ("inactive_membership_id") REFERENCES "public"."inactive_memberships"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "tokens" ADD CONSTRAINT "tokens_created_by_users_id_fk" FOREIGN KEY ("created_by") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "totps" ADD CONSTRAINT "totps_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "unsubscribe_tokens" ADD CONSTRAINT "unsubscribe_tokens_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "users" ADD CONSTRAINT "users_modified_by_users_id_fk" FOREIGN KEY ("modified_by") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
Expand Down
3 changes: 0 additions & 3 deletions backend/drizzle/0001_absurd_whiplash.sql

This file was deleted.

170 changes: 118 additions & 52 deletions backend/drizzle/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "eb63c351-3bd9-470d-a7ae-afb456ca323a",
"id": "75889fe0-7d35-4d97-8fda-974acbbaaaa2",
"prevId": "00000000-0000-0000-0000-000000000000",
"version": "7",
"dialect": "postgresql",
Expand Down Expand Up @@ -277,8 +277,8 @@
"checkConstraints": {},
"isRLSEnabled": false
},
"public.memberships": {
"name": "memberships",
"public.inactive_memberships": {
"name": "inactive_memberships",
"schema": "",
"columns": {
"created_at": {
Expand All @@ -304,7 +304,7 @@
"name": "user_id",
"type": "varchar",
"primaryKey": false,
"notNull": true
"notNull": false
},
"role": {
"name": "role",
Expand All @@ -313,23 +313,114 @@
"notNull": true,
"default": "'member'"
},
"token_id": {
"name": "token_id",
"type": "varchar",
"rejected_at": {
"name": "rejected_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"activated_at": {
"name": "activated_at",
"created_by": {
"name": "created_by",
"type": "varchar",
"primaryKey": false,
"notNull": true
},
"organization_id": {
"name": "organization_id",
"type": "varchar",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {
"inactive_memberships_user_id_users_id_fk": {
"name": "inactive_memberships_user_id_users_id_fk",
"tableFrom": "inactive_memberships",
"tableTo": "users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"inactive_memberships_created_by_users_id_fk": {
"name": "inactive_memberships_created_by_users_id_fk",
"tableFrom": "inactive_memberships",
"tableTo": "users",
"columnsFrom": [
"created_by"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"inactive_memberships_organization_id_organizations_id_fk": {
"name": "inactive_memberships_organization_id_organizations_id_fk",
"tableFrom": "inactive_memberships",
"tableTo": "organizations",
"columnsFrom": [
"organization_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.memberships": {
"name": "memberships",
"schema": "",
"columns": {
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
"notNull": true,
"default": "now()"
},
"id": {
"name": "id",
"type": "varchar",
"primaryKey": true,
"notNull": true
},
"context_type": {
"name": "context_type",
"type": "varchar",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "varchar",
"primaryKey": false,
"notNull": true
},
"role": {
"name": "role",
"type": "varchar",
"primaryKey": false,
"notNull": true,
"default": "'member'"
},
"created_by": {
"name": "created_by",
"type": "varchar",
"primaryKey": false,
"notNull": false
"notNull": true
},
"modified_at": {
"name": "modified_at",
Expand Down Expand Up @@ -385,19 +476,6 @@
"onDelete": "cascade",
"onUpdate": "no action"
},
"memberships_token_id_tokens_id_fk": {
"name": "memberships_token_id_tokens_id_fk",
"tableFrom": "memberships",
"tableTo": "tokens",
"columnsFrom": [
"token_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"memberships_created_by_users_id_fk": {
"name": "memberships_created_by_users_id_fk",
"tableFrom": "memberships",
Expand Down Expand Up @@ -1155,18 +1233,6 @@
"primaryKey": false,
"notNull": true
},
"entity_type": {
"name": "entity_type",
"type": "varchar",
"primaryKey": false,
"notNull": false
},
"role": {
"name": "role",
"type": "varchar",
"primaryKey": false,
"notNull": false
},
"user_id": {
"name": "user_id",
"type": "varchar",
Expand All @@ -1179,6 +1245,12 @@
"primaryKey": false,
"notNull": false
},
"inactive_membership_id": {
"name": "inactive_membership_id",
"type": "varchar",
"primaryKey": false,
"notNull": false
},
"created_by": {
"name": "created_by",
"type": "varchar",
Expand All @@ -1196,12 +1268,6 @@
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"organization_id": {
"name": "organization_id",
"type": "varchar",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
Expand Down Expand Up @@ -1229,28 +1295,28 @@
"columnsTo": [
"id"
],
"onDelete": "set null",
"onDelete": "cascade",
"onUpdate": "no action"
},
"tokens_created_by_users_id_fk": {
"name": "tokens_created_by_users_id_fk",
"tokens_inactive_membership_id_inactive_memberships_id_fk": {
"name": "tokens_inactive_membership_id_inactive_memberships_id_fk",
"tableFrom": "tokens",
"tableTo": "users",
"tableTo": "inactive_memberships",
"columnsFrom": [
"created_by"
"inactive_membership_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onDelete": "cascade",
"onUpdate": "no action"
},
"tokens_organization_id_organizations_id_fk": {
"name": "tokens_organization_id_organizations_id_fk",
"tokens_created_by_users_id_fk": {
"name": "tokens_created_by_users_id_fk",
"tableFrom": "tokens",
"tableTo": "organizations",
"tableTo": "users",
"columnsFrom": [
"organization_id"
"created_by"
],
"columnsTo": [
"id"
Expand Down
Loading
Loading