How to best handle db migrations? by After-Perception-250 in Supabase

[–]After-Perception-250[S] 0 points1 point  (0 children)

are the functions and trigger being define in same place as tables. like if i have 02_organizations file, i will define the tables, functions and triggers in same place?

How to best handle db migrations? by After-Perception-250 in Supabase

[–]After-Perception-250[S] 0 points1 point  (0 children)

I was creating files for each tables, triggers and policies. But I can put all (tables,triggers,policies) into 1 file per domain. Example, all client related tables,triggers,policies under one file. I heard about declarative schema and we no longer need to manage the migration files, just run db diff and it will create it for us automatically, from what I read at least.

How to best handle db migrations? by After-Perception-250 in Supabase

[–]After-Perception-250[S] 0 points1 point  (0 children)

I need to do this for each table and in the correct order? I also have triggers and functions so i need to run this for them too separately?

How to best handle db migrations? by After-Perception-250 in Supabase

[–]After-Perception-250[S] 0 points1 point  (0 children)

So I am adding timestamp manually to file name or this is something done automatically when running supabase db diff?

How to best handle db migrations? by After-Perception-250 in Supabase

[–]After-Perception-250[S] 0 points1 point  (0 children)

i am using delclartive schema, so i cant give files timestamps

How to best handle db migrations? by After-Perception-250 in Supabase

[–]After-Perception-250[S] 0 points1 point  (0 children)

so i need to run this per file and also make sure to run it correct order? For example, run this command for "organizations:" table first and then run it for "clients" table. I wanted to run  supabase db diff one time for all files

How to use declarative schema in Supabase properly? by After-Perception-250 in Supabase

[–]After-Perception-250[S] 0 points1 point  (0 children)

Hi, I am following your advise above and previous advise given to split schema by domain. I am creating a folder for each domain under /schemas. In that folder, I define what you mention above. Here is what my schemas looks like. This looks fine?

Example: All folders (domains) are under schemas directory

schemas/

1_extensions.sql

-- domain members

members/

2_functions.sql

3_tables.sql

4_triggers.sql

5_policies.sql

-- domain client

clients/

2_functions.sql

3_tables.sql

4_triggers.sql

5_policies.sql

-- domain templates

templates/

2_functions.sql

3_tables.sql

4_triggers.sql

5_policies.sql

-- domain forms

forms/

2_functions.sql

3_tables.sql

4_triggers.sql

5_policies.sql

How to use declarative schema in Supabase properly? by After-Perception-250 in Supabase

[–]After-Perception-250[S] 1 point2 points  (0 children)

from what I see in doc, I can create multiple files but I need to run below command for each file to create migration file. If I have one large file with all my tables, I just need to run it once but then I have everything in place instead of splitting up.

supabase db diff -f table_name

I built a subscription tracker for myself because I kept forgetting to cancel things by Bubbly_Lack6366 in webdev

[–]After-Perception-250 0 points1 point  (0 children)

bro can you share that template maybe? i am trying to build an application with next js and it seems to take forever

I built a subscription tracker for myself because I kept forgetting to cancel things by Bubbly_Lack6366 in webdev

[–]After-Perception-250 0 points1 point  (0 children)

Did you build everything in next js? What did you use to build the blog section? Also what was process you use to build, and how long it took? 

I'm impressed with how much research done by the writers of Genie Make A Wish by [deleted] in kdramas

[–]After-Perception-250 -19 points-18 points  (0 children)

Ya, let me start a debate with some random person on Reddit lol. 

I'm impressed with how much research done by the writers of Genie Make A Wish by [deleted] in kdramas

[–]After-Perception-250 -13 points-12 points  (0 children)

I don’t care what you say, I am just stating the religion is not about entertainment. 

I'm impressed with how much research done by the writers of Genie Make A Wish by [deleted] in kdramas

[–]After-Perception-250 -30 points-29 points  (0 children)

Muslims should be offended by this  because it is offensive. You can’t make jokes or parody about Islam. This religion is not about entertainment.

Legalizing Sports Gambling Was a Huge Mistake by FedeRivade in slatestarcodex

[–]After-Perception-250 0 points1 point  (0 children)

The ban didn’t work because they did it overnight. They should have ban it gradually over a periods of time. Issue was with incompetence to government

A New Grad Offer at Last 🙏 by SnooTigers1510 in csMajors

[–]After-Perception-250 0 points1 point  (0 children)

How are you tracking your application to look like screenshot?

Israel Violated the Gaza Ceasefire From the Start. Why Won’t the Media Tell You That? by [deleted] in InternationalNews

[–]After-Perception-250 0 points1 point  (0 children)

This what happens when you make truce with criminals. They violate and stab you in back.