@nextblock-cms/db 0.2.8 → 0.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/supabase/client.d.ts +9 -0
- package/lib/supabase/middleware.d.ts +2 -0
- package/lib/supabase/server.d.ts +7 -0
- package/lib/supabase/ssg-client.d.ts +2 -0
- package/lib/supabase/types.d.ts +635 -0
- package/package.json +3 -13
- package/supabase/config.toml +0 -319
- package/supabase/migrations/20250513194738_setup_roles_and_profiles.sql +0 -41
- package/supabase/migrations/20250513194910_auto_create_profile_trigger.sql +0 -48
- package/supabase/migrations/20250513194916_rls_for_profiles.sql +0 -85
- package/supabase/migrations/20250514125634_fix_recursive_rls_policies.sql +0 -51
- package/supabase/migrations/20250514143016_setup_languages_table.sql +0 -66
- package/supabase/migrations/20250514171549_create_pages_table.sql +0 -73
- package/supabase/migrations/20250514171550_create_posts_table.sql +0 -61
- package/supabase/migrations/20250514171552_create_media_table.sql +0 -45
- package/supabase/migrations/20250514171553_create_blocks_table.sql +0 -54
- package/supabase/migrations/20250514171615_create_navigation_table.sql +0 -56
- package/supabase/migrations/20250514171627_rls_policies_for_content_tables.sql +0 -70
- package/supabase/migrations/20250515194800_add_translation_group_id.sql +0 -39
- package/supabase/migrations/20250520171900_add_translation_group_to_nav_items.sql +0 -21
- package/supabase/migrations/20250521143933_seed_homepage_and_nav.sql +0 -64
- package/supabase/migrations/20250523145833_add_feature_image_to_posts.sql +0 -8
- package/supabase/migrations/20250523151737_add_rls_to_media_table.sql +0 -18
- package/supabase/migrations/20250526110400_add_image_dimensions_to_media.sql +0 -14
- package/supabase/migrations/20250526153321_optimize_rls_policies.sql +0 -188
- package/supabase/migrations/20250526172513_resolve_select_policy_overlaps.sql +0 -96
- package/supabase/migrations/20250526172853_resolve_remaining_rls_v5.sql +0 -107
- package/supabase/migrations/20250526173538_finalize_rls_cleanup_v7.sql +0 -110
- package/supabase/migrations/20250526174710_separate_write_policies_v8.sql +0 -147
- package/supabase/migrations/20250526175359_fix_languages_select_rls_v9.sql +0 -81
- package/supabase/migrations/20250526182940_fix_nav_read_policy_v10.sql +0 -27
- package/supabase/migrations/20250526183239_fix_posts_read_rls_v11.sql +0 -59
- package/supabase/migrations/20250526183746_fix_media_select_rls_v12.sql +0 -39
- package/supabase/migrations/20250526184205_consolidate_content_read_rls_v13.sql +0 -61
- package/supabase/migrations/20250526185854_optimize_indexes.sql +0 -47
- package/supabase/migrations/20250526190900_debug_blocks_rls.sql +0 -56
- package/supabase/migrations/20250526191217_consolidate_blocks_select_rls.sql +0 -79
- package/supabase/migrations/20250526192822_fix_handle_languages_update_search_path.sql +0 -32
- package/supabase/migrations/20250527150500_fix_blocks_rls_policy.sql +0 -54
- package/supabase/migrations/20250602150602_add_blur_data_url_to_media.sql +0 -4
- package/supabase/migrations/20250602150959_add_variants_to_media.sql +0 -4
- package/supabase/migrations/20250618124000_create_get_my_claim_function.sql +0 -5
- package/supabase/migrations/20250618124100_create_logos_table.sql +0 -29
- package/supabase/migrations/20250618130000_fix_linter_warnings.sql +0 -58
- package/supabase/migrations/20250618151500_revert_storage_rls.sql +0 -6
- package/supabase/migrations/20250619084800_reinstate_storage_rls.sql +0 -13
- package/supabase/migrations/20250619092430_widen_logo_insert_policy.sql +0 -6
- package/supabase/migrations/20250619093122_fix_get_my_claim_volatility.sql +0 -5
- package/supabase/migrations/20250619104249_consolidated_logo_rls_fix.sql +0 -56
- package/supabase/migrations/20250619110700_fix_logo_rls_again.sql +0 -59
- package/supabase/migrations/20250619113200_add_file_path_to_media.sql +0 -4
- package/supabase/migrations/20250619124100_fix_rls_performance_warnings.sql +0 -74
- package/supabase/migrations/20250619195500_create_site_settings_table.sql +0 -28
- package/supabase/migrations/20250619201500_add_anon_read_to_site_settings.sql +0 -7
- package/supabase/migrations/20250619202000_add_is_active_to_languages.sql +0 -5
- package/supabase/migrations/20250620085700_fix_site_settings_write_rls.sql +0 -27
- package/supabase/migrations/20250620095500_fix_profiles_read_rls.sql +0 -11
- package/supabase/migrations/20250620100000_use_security_definer_for_rls.sql +0 -39
- package/supabase/migrations/20250620130000_add_public_read_to_logos.sql +0 -4
- package/supabase/migrations/20250708091700_create_translations_table.sql +0 -55
- package/supabase/migrations/20250708093403_seed_translations_table.sql +0 -20
- package/supabase/migrations/20250708110600_fix_translations_rls_policies.sql +0 -11
- package/supabase/migrations/20250708112300_add_new_translations.sql +0 -9
- package/supabase/migrations/20250709120000_create_revisions_tables.sql +0 -109
- package/supabase/migrations/20251001113000_add_folder_to_media.sql +0 -14
- package/supabase/migrations/20251112113736_fix_search_path_functions.sql +0 -74
- package/supabase/migrations/20251112124444_fix_rls_performance.sql +0 -63
- package/supabase/migrations/20251112125935_fix_combined_policies.sql +0 -194
- package/supabase/migrations/20251112132146_fix_foreign_key_indexes.sql +0 -21
- package/supabase/migrations/20251112132525_cleanup_unused_indexes.sql +0 -10
- package/supabase/migrations/20251112132822_fix_final_indexes.sql +0 -14
- package/supabase/migrations/20251112140000_scaffold_foundational_content.sql +0 -95
- package/supabase/migrations/20251112141000_seed_homepage_blocks.sql +0 -656
- package/supabase/migrations/20251112142000_seed_how_it_works_post_blocks.sql +0 -100
- package/supabase/migrations/20251112143000_seed_additional_translations.sql +0 -102
- package/supabase/migrations/20251112145000_grant_public_schema_usage.sql +0 -6
- package/supabase/migrations/20251112145500_grant_select_on_public_tables.sql +0 -19
- package/supabase/migrations/20251117093000_add_admin_created_flag.sql +0 -21
- package/supabase/migrations/20251117103000_relax_profile_username_constraint.sql +0 -6
- package/supabase/migrations/20251117110000_relax_profiles_site_settings_rls_for_signup.sql +0 -20
- package/supabase/migrations/20251117112000_fix_handle_new_user_role_enum.sql +0 -45
- package/supabase/migrations/20251117113000_cleanup_rls_duplicates.sql +0 -20
- package/supabase/migrations/20251117200000_media_service_role_insert.sql +0 -14
- package/supabase/migrations/20251117201500_media_service_role_select.sql +0 -11
- package/supabase/migrations/20251117203000_media_admin_writer_select.sql +0 -11
- package/supabase/migrations/20251117204500_fix_media_permissions.sql +0 -43
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
BEGIN;
|
|
2
|
-
|
|
3
|
-
-- Consolidate logo read access into a single policy for the authenticated role.
|
|
4
|
-
DROP POLICY IF EXISTS "Allow public read access to logos" ON public.logos;
|
|
5
|
-
DROP POLICY IF EXISTS "Allow read access for authenticated users on logos" ON public.logos;
|
|
6
|
-
|
|
7
|
-
CREATE POLICY "logos_authenticated_select_combined"
|
|
8
|
-
ON public.logos
|
|
9
|
-
FOR SELECT
|
|
10
|
-
TO authenticated
|
|
11
|
-
USING (true);
|
|
12
|
-
|
|
13
|
-
-- Page revisions: remove overlapping SELECT coverage and keep a single policy per action.
|
|
14
|
-
DROP POLICY IF EXISTS page_revisions_admin_writer_management ON public.page_revisions;
|
|
15
|
-
DROP POLICY IF EXISTS page_revisions_authenticated_read ON public.page_revisions;
|
|
16
|
-
|
|
17
|
-
CREATE POLICY "page_revisions_authenticated_select_combined"
|
|
18
|
-
ON public.page_revisions
|
|
19
|
-
FOR SELECT
|
|
20
|
-
TO authenticated
|
|
21
|
-
USING (true);
|
|
22
|
-
|
|
23
|
-
CREATE POLICY "page_revisions_admin_writer_insert"
|
|
24
|
-
ON public.page_revisions
|
|
25
|
-
FOR INSERT
|
|
26
|
-
TO authenticated
|
|
27
|
-
WITH CHECK (
|
|
28
|
-
EXISTS (
|
|
29
|
-
SELECT 1 FROM public.profiles
|
|
30
|
-
WHERE id = (SELECT auth.uid()) AND role IN ('ADMIN', 'WRITER')
|
|
31
|
-
)
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
CREATE POLICY "page_revisions_admin_writer_update"
|
|
35
|
-
ON public.page_revisions
|
|
36
|
-
FOR UPDATE
|
|
37
|
-
TO authenticated
|
|
38
|
-
USING (
|
|
39
|
-
EXISTS (
|
|
40
|
-
SELECT 1 FROM public.profiles
|
|
41
|
-
WHERE id = (SELECT auth.uid()) AND role IN ('ADMIN', 'WRITER')
|
|
42
|
-
)
|
|
43
|
-
)
|
|
44
|
-
WITH CHECK (
|
|
45
|
-
EXISTS (
|
|
46
|
-
SELECT 1 FROM public.profiles
|
|
47
|
-
WHERE id = (SELECT auth.uid()) AND role IN ('ADMIN', 'WRITER')
|
|
48
|
-
)
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
CREATE POLICY "page_revisions_admin_writer_delete"
|
|
52
|
-
ON public.page_revisions
|
|
53
|
-
FOR DELETE
|
|
54
|
-
TO authenticated
|
|
55
|
-
USING (
|
|
56
|
-
EXISTS (
|
|
57
|
-
SELECT 1 FROM public.profiles
|
|
58
|
-
WHERE id = (SELECT auth.uid()) AND role IN ('ADMIN', 'WRITER')
|
|
59
|
-
)
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
-- Post revisions: same treatment as page revisions.
|
|
63
|
-
DROP POLICY IF EXISTS post_revisions_admin_writer_management ON public.post_revisions;
|
|
64
|
-
DROP POLICY IF EXISTS post_revisions_authenticated_read ON public.post_revisions;
|
|
65
|
-
|
|
66
|
-
CREATE POLICY "post_revisions_authenticated_select_combined"
|
|
67
|
-
ON public.post_revisions
|
|
68
|
-
FOR SELECT
|
|
69
|
-
TO authenticated
|
|
70
|
-
USING (true);
|
|
71
|
-
|
|
72
|
-
CREATE POLICY "post_revisions_admin_writer_insert"
|
|
73
|
-
ON public.post_revisions
|
|
74
|
-
FOR INSERT
|
|
75
|
-
TO authenticated
|
|
76
|
-
WITH CHECK (
|
|
77
|
-
EXISTS (
|
|
78
|
-
SELECT 1 FROM public.profiles
|
|
79
|
-
WHERE id = (SELECT auth.uid()) AND role IN ('ADMIN', 'WRITER')
|
|
80
|
-
)
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
CREATE POLICY "post_revisions_admin_writer_update"
|
|
84
|
-
ON public.post_revisions
|
|
85
|
-
FOR UPDATE
|
|
86
|
-
TO authenticated
|
|
87
|
-
USING (
|
|
88
|
-
EXISTS (
|
|
89
|
-
SELECT 1 FROM public.profiles
|
|
90
|
-
WHERE id = (SELECT auth.uid()) AND role IN ('ADMIN', 'WRITER')
|
|
91
|
-
)
|
|
92
|
-
)
|
|
93
|
-
WITH CHECK (
|
|
94
|
-
EXISTS (
|
|
95
|
-
SELECT 1 FROM public.profiles
|
|
96
|
-
WHERE id = (SELECT auth.uid()) AND role IN ('ADMIN', 'WRITER')
|
|
97
|
-
)
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
CREATE POLICY "post_revisions_admin_writer_delete"
|
|
101
|
-
ON public.post_revisions
|
|
102
|
-
FOR DELETE
|
|
103
|
-
TO authenticated
|
|
104
|
-
USING (
|
|
105
|
-
EXISTS (
|
|
106
|
-
SELECT 1 FROM public.profiles
|
|
107
|
-
WHERE id = (SELECT auth.uid()) AND role IN ('ADMIN', 'WRITER')
|
|
108
|
-
)
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
-- Site settings: collapse overlapping policies per action.
|
|
112
|
-
DROP POLICY IF EXISTS "Allow ADMIN and WRITER to insert into site_settings" ON public.site_settings;
|
|
113
|
-
DROP POLICY IF EXISTS "Allow admins full access on site_settings" ON public.site_settings;
|
|
114
|
-
DROP POLICY IF EXISTS "Allow insert based on user role" ON public.site_settings;
|
|
115
|
-
DROP POLICY IF EXISTS "Allow authenticated users to read site_settings" ON public.site_settings;
|
|
116
|
-
DROP POLICY IF EXISTS "Allow update based on user role" ON public.site_settings;
|
|
117
|
-
DROP POLICY IF EXISTS "Allow ADMIN and WRITER to update site_settings" ON public.site_settings;
|
|
118
|
-
DROP POLICY IF EXISTS "Allow ADMIN and WRITER to modify site_settings" ON public.site_settings;
|
|
119
|
-
|
|
120
|
-
CREATE POLICY "site_settings_authenticated_insert_combined"
|
|
121
|
-
ON public.site_settings
|
|
122
|
-
FOR INSERT
|
|
123
|
-
TO authenticated
|
|
124
|
-
WITH CHECK (
|
|
125
|
-
EXISTS (
|
|
126
|
-
SELECT 1 FROM public.profiles
|
|
127
|
-
WHERE id = (SELECT auth.uid()) AND role IN ('ADMIN', 'WRITER')
|
|
128
|
-
)
|
|
129
|
-
);
|
|
130
|
-
|
|
131
|
-
CREATE POLICY "site_settings_authenticated_select_combined"
|
|
132
|
-
ON public.site_settings
|
|
133
|
-
FOR SELECT
|
|
134
|
-
TO authenticated
|
|
135
|
-
USING (true);
|
|
136
|
-
|
|
137
|
-
CREATE POLICY "site_settings_authenticated_update_combined"
|
|
138
|
-
ON public.site_settings
|
|
139
|
-
FOR UPDATE
|
|
140
|
-
TO authenticated
|
|
141
|
-
USING (
|
|
142
|
-
EXISTS (
|
|
143
|
-
SELECT 1 FROM public.profiles
|
|
144
|
-
WHERE id = (SELECT auth.uid()) AND role IN ('ADMIN', 'WRITER')
|
|
145
|
-
)
|
|
146
|
-
)
|
|
147
|
-
WITH CHECK (
|
|
148
|
-
EXISTS (
|
|
149
|
-
SELECT 1 FROM public.profiles
|
|
150
|
-
WHERE id = (SELECT auth.uid()) AND role IN ('ADMIN', 'WRITER')
|
|
151
|
-
)
|
|
152
|
-
);
|
|
153
|
-
|
|
154
|
-
CREATE POLICY "site_settings_authenticated_delete_combined"
|
|
155
|
-
ON public.site_settings
|
|
156
|
-
FOR DELETE
|
|
157
|
-
TO authenticated
|
|
158
|
-
USING (
|
|
159
|
-
EXISTS (
|
|
160
|
-
SELECT 1 FROM public.profiles
|
|
161
|
-
WHERE id = (SELECT auth.uid()) AND role IN ('ADMIN', 'WRITER')
|
|
162
|
-
)
|
|
163
|
-
);
|
|
164
|
-
|
|
165
|
-
-- Translations: split FOR ALL coverage into distinct policies.
|
|
166
|
-
DROP POLICY IF EXISTS "Allow authenticated users to manage translations" ON public.translations;
|
|
167
|
-
DROP POLICY IF EXISTS "Allow read access to all authenticated users" ON public.translations;
|
|
168
|
-
|
|
169
|
-
CREATE POLICY "translations_authenticated_select_combined"
|
|
170
|
-
ON public.translations
|
|
171
|
-
FOR SELECT
|
|
172
|
-
TO authenticated
|
|
173
|
-
USING (true);
|
|
174
|
-
|
|
175
|
-
CREATE POLICY "translations_authenticated_insert_combined"
|
|
176
|
-
ON public.translations
|
|
177
|
-
FOR INSERT
|
|
178
|
-
TO authenticated
|
|
179
|
-
WITH CHECK (true);
|
|
180
|
-
|
|
181
|
-
CREATE POLICY "translations_authenticated_update_combined"
|
|
182
|
-
ON public.translations
|
|
183
|
-
FOR UPDATE
|
|
184
|
-
TO authenticated
|
|
185
|
-
USING (true)
|
|
186
|
-
WITH CHECK (true);
|
|
187
|
-
|
|
188
|
-
CREATE POLICY "translations_authenticated_delete_combined"
|
|
189
|
-
ON public.translations
|
|
190
|
-
FOR DELETE
|
|
191
|
-
TO authenticated
|
|
192
|
-
USING (true);
|
|
193
|
-
|
|
194
|
-
COMMIT;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
BEGIN;
|
|
2
|
-
|
|
3
|
-
-- Add missing coverage for frequently joined foreign keys.
|
|
4
|
-
CREATE INDEX IF NOT EXISTS idx_logos_media_id
|
|
5
|
-
ON public.logos (media_id);
|
|
6
|
-
|
|
7
|
-
CREATE INDEX IF NOT EXISTS idx_page_revisions_author_id
|
|
8
|
-
ON public.page_revisions (author_id);
|
|
9
|
-
|
|
10
|
-
CREATE INDEX IF NOT EXISTS idx_post_revisions_author_id
|
|
11
|
-
ON public.post_revisions (author_id);
|
|
12
|
-
|
|
13
|
-
-- Drop unused or redundant indexes called out by Supabase insights.
|
|
14
|
-
DROP INDEX IF EXISTS idx_page_revisions_page_id_version;
|
|
15
|
-
DROP INDEX IF EXISTS idx_post_revisions_post_id_version;
|
|
16
|
-
DROP INDEX IF EXISTS idx_post_revisions_post_id;
|
|
17
|
-
DROP INDEX IF EXISTS idx_pages_translation_group_id;
|
|
18
|
-
DROP INDEX IF EXISTS idx_posts_translation_group_id;
|
|
19
|
-
DROP INDEX IF EXISTS idx_navigation_items_menu_lang_order;
|
|
20
|
-
|
|
21
|
-
COMMIT;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
BEGIN;
|
|
2
|
-
|
|
3
|
-
-- Drop redundant or legacy indexes highlighted by Supabase Advisor.
|
|
4
|
-
DROP INDEX IF EXISTS media_folder_idx;
|
|
5
|
-
DROP INDEX IF EXISTS idx_blocks_language_id;
|
|
6
|
-
DROP INDEX IF EXISTS idx_blocks_post_id;
|
|
7
|
-
DROP INDEX IF EXISTS idx_navigation_items_language_id;
|
|
8
|
-
DROP INDEX IF EXISTS idx_page_revisions_page_id;
|
|
9
|
-
|
|
10
|
-
COMMIT;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
BEGIN;
|
|
2
|
-
|
|
3
|
-
CREATE INDEX IF NOT EXISTS idx_blocks_language_id
|
|
4
|
-
ON public.blocks (language_id);
|
|
5
|
-
|
|
6
|
-
CREATE INDEX IF NOT EXISTS idx_blocks_post_id
|
|
7
|
-
ON public.blocks (post_id);
|
|
8
|
-
|
|
9
|
-
CREATE INDEX IF NOT EXISTS idx_navigation_items_language_id
|
|
10
|
-
ON public.navigation_items (language_id);
|
|
11
|
-
|
|
12
|
-
ANALYZE VERBOSE;
|
|
13
|
-
|
|
14
|
-
COMMIT;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
-- supabase/migrations/20251112140000_scaffold_foundational_content.sql
|
|
2
|
-
-- seeds additional languages plus the foundational Home/Articles pages and flagship post translations
|
|
3
|
-
|
|
4
|
-
do $migration$
|
|
5
|
-
declare
|
|
6
|
-
v_home_page_group_id uuid := gen_random_uuid();
|
|
7
|
-
v_blog_page_group_id uuid := gen_random_uuid();
|
|
8
|
-
v_how_it_works_post_group_id uuid := gen_random_uuid();
|
|
9
|
-
v_en_lang_id bigint;
|
|
10
|
-
v_fr_lang_id bigint;
|
|
11
|
-
v_feature_media_id uuid;
|
|
12
|
-
begin
|
|
13
|
-
-- only english and french
|
|
14
|
-
insert into public.languages (id, name, code, is_default, is_active)
|
|
15
|
-
values
|
|
16
|
-
(1, 'English', 'en', true, true),
|
|
17
|
-
(2, 'Français', 'fr', false, true)
|
|
18
|
-
on conflict (id) do update
|
|
19
|
-
set name = excluded.name,
|
|
20
|
-
code = excluded.code,
|
|
21
|
-
is_default = excluded.is_default,
|
|
22
|
-
is_active = excluded.is_active;
|
|
23
|
-
|
|
24
|
-
select id into v_en_lang_id from public.languages where code = 'en' limit 1;
|
|
25
|
-
select id into v_fr_lang_id from public.languages where code = 'fr' limit 1;
|
|
26
|
-
|
|
27
|
-
if v_en_lang_id is null or v_fr_lang_id is null then
|
|
28
|
-
raise exception 'Required languages (en, fr) not found. Please seed languages first.';
|
|
29
|
-
end if;
|
|
30
|
-
|
|
31
|
-
-- reset defaults/actives
|
|
32
|
-
update public.languages
|
|
33
|
-
set is_active = true,
|
|
34
|
-
is_default = case when code = 'en' then true else false end
|
|
35
|
-
where code in ('en', 'fr');
|
|
36
|
-
|
|
37
|
-
-- scaffold the Home and Articles parent pages (EN + FR)
|
|
38
|
-
insert into public.pages (language_id, title, slug, status, translation_group_id)
|
|
39
|
-
values (v_en_lang_id, 'Home', 'home', 'published', v_home_page_group_id)
|
|
40
|
-
on conflict (language_id, slug) do update
|
|
41
|
-
set title = excluded.title,
|
|
42
|
-
status = excluded.status,
|
|
43
|
-
translation_group_id = excluded.translation_group_id;
|
|
44
|
-
|
|
45
|
-
insert into public.pages (language_id, title, slug, status, translation_group_id)
|
|
46
|
-
values (v_fr_lang_id, 'Accueil', 'accueil', 'published', v_home_page_group_id)
|
|
47
|
-
on conflict (language_id, slug) do update
|
|
48
|
-
set title = excluded.title,
|
|
49
|
-
status = excluded.status,
|
|
50
|
-
translation_group_id = excluded.translation_group_id;
|
|
51
|
-
|
|
52
|
-
insert into public.pages (language_id, title, slug, status, translation_group_id)
|
|
53
|
-
values (v_en_lang_id, 'Articles', 'articles', 'published', v_blog_page_group_id)
|
|
54
|
-
on conflict (language_id, slug) do update
|
|
55
|
-
set title = excluded.title,
|
|
56
|
-
status = excluded.status,
|
|
57
|
-
translation_group_id = excluded.translation_group_id;
|
|
58
|
-
|
|
59
|
-
insert into public.pages (language_id, title, slug, status, translation_group_id)
|
|
60
|
-
values (v_fr_lang_id, 'Articles', 'articles', 'published', v_blog_page_group_id)
|
|
61
|
-
on conflict (language_id, slug) do update
|
|
62
|
-
set title = excluded.title,
|
|
63
|
-
status = excluded.status,
|
|
64
|
-
translation_group_id = excluded.translation_group_id;
|
|
65
|
-
|
|
66
|
-
-- seed the flagship How It Works blog post in EN + FR
|
|
67
|
-
insert into public.posts (language_id, title, slug, status, translation_group_id)
|
|
68
|
-
values (v_en_lang_id, 'How NextBlock Works: A Look Under the Hood', 'how-nextblock-works', 'published', v_how_it_works_post_group_id)
|
|
69
|
-
on conflict (language_id, slug) do update
|
|
70
|
-
set title = excluded.title,
|
|
71
|
-
status = excluded.status,
|
|
72
|
-
translation_group_id = excluded.translation_group_id;
|
|
73
|
-
|
|
74
|
-
insert into public.posts (language_id, title, slug, status, translation_group_id)
|
|
75
|
-
values (v_fr_lang_id, 'Comment NextBlock Fonctionne : Regard Sous le Capot', 'comment-nextblock-fonctionne', 'published', v_how_it_works_post_group_id)
|
|
76
|
-
on conflict (language_id, slug) do update
|
|
77
|
-
set title = excluded.title,
|
|
78
|
-
status = excluded.status,
|
|
79
|
-
translation_group_id = excluded.translation_group_id;
|
|
80
|
-
|
|
81
|
-
-- Feature image for the flagship post can be set later via CMS; no seed insert for static asset.
|
|
82
|
-
end;
|
|
83
|
-
$migration$;
|
|
84
|
-
|
|
85
|
-
select id as home_page_id
|
|
86
|
-
from public.pages
|
|
87
|
-
where slug = 'home' and language_id = (select id from public.languages where code = 'en' limit 1)
|
|
88
|
-
order by created_at desc
|
|
89
|
-
limit 1;
|
|
90
|
-
|
|
91
|
-
select id as post_id
|
|
92
|
-
from public.posts
|
|
93
|
-
where slug = 'how-nextblock-works' and language_id = (select id from public.languages where code = 'en' limit 1)
|
|
94
|
-
order by created_at desc
|
|
95
|
-
limit 1;
|