This commit is contained in:
Sakurasan
2026-07-05 21:29:17 +08:00
commit 013ebdaffe
150 changed files with 15614 additions and 0 deletions
@@ -0,0 +1,6 @@
-- ============================================
-- 此文件由 Meoo Cloud 自动生成,请勿修改
-- This file is auto-generated by Meoo Cloud, DO NOT MODIFY
-- ============================================
CREATE TABLE stock_collections (id SERIAL PRIMARY KEY, name VARCHAR(100) NOT NULL, description TEXT, created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW());
@@ -0,0 +1,6 @@
-- ============================================
-- 此文件由 Meoo Cloud 自动生成,请勿修改
-- This file is auto-generated by Meoo Cloud, DO NOT MODIFY
-- ============================================
CREATE TABLE collection_stocks (id SERIAL PRIMARY KEY, collection_id INTEGER NOT NULL REFERENCES stock_collections(id) ON DELETE CASCADE, stock_code VARCHAR(10) NOT NULL, stock_name VARCHAR(50) NOT NULL, added_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), UNIQUE(collection_id, stock_code));
+6
View File
@@ -0,0 +1,6 @@
-- ============================================
-- 此文件由 Meoo Cloud 自动生成,请勿修改
-- This file is auto-generated by Meoo Cloud, DO NOT MODIFY
-- ============================================
CREATE TABLE share_links (id SERIAL PRIMARY KEY, collection_id INTEGER NOT NULL REFERENCES stock_collections(id) ON DELETE CASCADE, short_code VARCHAR(20) NOT NULL UNIQUE, created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), expires_at TIMESTAMPTZ);
+6
View File
@@ -0,0 +1,6 @@
-- ============================================
-- 此文件由 Meoo Cloud 自动生成,请勿修改
-- This file is auto-generated by Meoo Cloud, DO NOT MODIFY
-- ============================================
ALTER TABLE stock_collections ENABLE ROW LEVEL SECURITY; CREATE POLICY anon_all_stock_collections ON stock_collections FOR ALL USING (true) WITH CHECK (true);
+6
View File
@@ -0,0 +1,6 @@
-- ============================================
-- 此文件由 Meoo Cloud 自动生成,请勿修改
-- This file is auto-generated by Meoo Cloud, DO NOT MODIFY
-- ============================================
ALTER TABLE collection_stocks ENABLE ROW LEVEL SECURITY; CREATE POLICY anon_all_collection_stocks ON collection_stocks FOR ALL USING (true) WITH CHECK (true);
+6
View File
@@ -0,0 +1,6 @@
-- ============================================
-- 此文件由 Meoo Cloud 自动生成,请勿修改
-- This file is auto-generated by Meoo Cloud, DO NOT MODIFY
-- ============================================
ALTER TABLE share_links ENABLE ROW LEVEL SECURITY; CREATE POLICY anon_all_share_links ON share_links FOR ALL USING (true) WITH CHECK (true);
+6
View File
@@ -0,0 +1,6 @@
-- ============================================
-- 此文件由 Meoo Cloud 自动生成,请勿修改
-- This file is auto-generated by Meoo Cloud, DO NOT MODIFY
-- ============================================
ALTER TABLE collection_stocks ADD COLUMN IF NOT EXISTS added_price DECIMAL(10,2);
@@ -0,0 +1,9 @@
-- ============================================
-- 此文件由 Meoo Cloud 自动生成,请勿修改
-- This file is auto-generated by Meoo Cloud, DO NOT MODIFY
-- ============================================
ALTER TABLE stock_collections ADD COLUMN user_id VARCHAR(100) NOT NULL DEFAULT '';
ALTER TABLE stock_collections ADD COLUMN last_accessed_at TIMESTAMPTZ NOT NULL DEFAULT NOW();
CREATE INDEX idx_stock_collections_user_id ON stock_collections(user_id);
CREATE INDEX idx_stock_collections_last_accessed ON stock_collections(last_accessed_at);
@@ -0,0 +1,6 @@
-- ============================================
-- 此文件由 Meoo Cloud 自动生成,请勿修改
-- This file is auto-generated by Meoo Cloud, DO NOT MODIFY
-- ============================================
ALTER TABLE stock_collections ADD COLUMN user_id VARCHAR(100) NOT NULL DEFAULT ''; ALTER TABLE stock_collections ADD COLUMN last_accessed_at TIMESTAMPTZ NOT NULL DEFAULT NOW(); CREATE INDEX idx_stock_collections_user_id ON stock_collections(user_id); CREATE INDEX idx_stock_collections_last_accessed ON stock_collections(last_accessed_at);
@@ -0,0 +1,6 @@
-- ============================================
-- 此文件由 Meoo Cloud 自动生成,请勿修改
-- This file is auto-generated by Meoo Cloud, DO NOT MODIFY
-- ============================================
ALTER TABLE stock_collections ENABLE ROW LEVEL SECURITY; DROP POLICY IF EXISTS anon_select_stock_collections ON stock_collections; DROP POLICY IF EXISTS anon_insert_stock_collections ON stock_collections; DROP POLICY IF EXISTS anon_update_stock_collections ON stock_collections; DROP POLICY IF EXISTS anon_delete_stock_collections ON stock_collections; CREATE POLICY user_select_stock_collections ON stock_collections FOR SELECT USING (true); CREATE POLICY user_insert_stock_collections ON stock_collections FOR INSERT WITH CHECK (true); CREATE POLICY user_update_stock_collections ON stock_collections FOR UPDATE USING (true); CREATE POLICY user_delete_stock_collections ON stock_collections FOR DELETE USING (true);
@@ -0,0 +1,6 @@
-- ============================================
-- 此文件由 Meoo Cloud 自动生成,请勿修改
-- This file is auto-generated by Meoo Cloud, DO NOT MODIFY
-- ============================================
ALTER TABLE collection_stocks ENABLE ROW LEVEL SECURITY; DROP POLICY IF EXISTS anon_select_collection_stocks ON collection_stocks; DROP POLICY IF EXISTS anon_insert_collection_stocks ON collection_stocks; DROP POLICY IF EXISTS anon_update_collection_stocks ON collection_stocks; DROP POLICY IF EXISTS anon_delete_collection_stocks ON collection_stocks; CREATE POLICY user_select_collection_stocks ON collection_stocks FOR SELECT USING (true); CREATE POLICY user_insert_collection_stocks ON collection_stocks FOR INSERT WITH CHECK (true); CREATE POLICY user_update_collection_stocks ON collection_stocks FOR UPDATE USING (true); CREATE POLICY user_delete_collection_stocks ON collection_stocks FOR DELETE USING (true);