Files
openwork/ee/apps/den-controller/drizzle/0005_temp_template_sharing.sql
Source Open 21d3b443a7 Add Den organizations, org permissions, and template sharing surfaces (#1172)
* Add Den org auth model and template APIs

Wire Better Auth organizations with TypeId-backed schema and migrations, enforce owner/admin org permissions, and add org-scoped template create/list/delete endpoints. Simplify the Den org dashboard UX and update Docker dev packaging paths for the ee apps/packages layout.

* Add manual-safe org migration SQL

Provide a Vitess-compatible version of the organization migration without statement-breakpoint markers or unsupported IF NOT EXISTS column syntax so operators can run it directly in SQL consoles.

---------

Co-authored-by: src-opn <src-opn@users.noreply.github.com>
2026-03-25 18:30:50 -07:00

15 lines
697 B
SQL

CREATE TABLE IF NOT EXISTS `temp_template_sharing` (
`id` varchar(64) NOT NULL,
`organization_id` varchar(64) NOT NULL,
`creator_member_id` varchar(64) NOT NULL,
`creator_user_id` varchar(64) NOT NULL,
`name` varchar(255) NOT NULL,
`template_json` text NOT NULL,
`created_at` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`updated_at` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
CONSTRAINT `temp_template_sharing_id` PRIMARY KEY(`id`),
KEY `temp_template_sharing_org_id` (`organization_id`),
KEY `temp_template_sharing_creator_member_id` (`creator_member_id`),
KEY `temp_template_sharing_creator_user_id` (`creator_user_id`)
);