-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsupabase-setup.sql
More file actions
21 lines (17 loc) · 891 Bytes
/
Copy pathsupabase-setup.sql
File metadata and controls
21 lines (17 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-- Create the raindrop_tokens table for storing encrypted OAuth tokens
CREATE TABLE IF NOT EXISTS raindrop_tokens (
id TEXT PRIMARY KEY,
encrypted_data TEXT NOT NULL,
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Create index for better performance
CREATE INDEX IF NOT EXISTS idx_raindrop_tokens_updated_at ON raindrop_tokens(updated_at);
-- Enable Row Level Security (RLS)
ALTER TABLE raindrop_tokens ENABLE ROW LEVEL SECURITY;
-- Create policy to allow all operations (since this is a server-side only table)
-- In production, you might want to restrict this further based on your security requirements
CREATE POLICY "Allow all operations on raindrop_tokens" ON raindrop_tokens
FOR ALL USING (true) WITH CHECK (true);
-- Grant necessary permissions to authenticated role
GRANT ALL ON raindrop_tokens TO authenticated;
GRANT ALL ON raindrop_tokens TO service_role;