Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created a supabase migration and updated readme for migration step #17

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

younusraza909
Copy link

@younusraza909 younusraza909 commented Oct 19, 2024

Ticket #16
@Pudi-Sravan Can you please look into this and merge it in your source code

@Pudi-Sravan
Copy link
Collaborator

hey @younusraza909 there was a change in the Readme file recently once kindly go through it and change the code accordingly and resolve the merge conflict.

@younusraza909
Copy link
Author

@Pudi-Sravan you can merge it now

@Pudi-Sravan
Copy link
Collaborator

Hey @younusraza909 once again check the type of data of the columns which have been mentioned in the tables in the Readme file and do the necessary changes,the tables you will be creating with this code you gave are for the one which was mentioned previously.

@Pudi-Sravan Pudi-Sravan self-requested a review October 20, 2024 20:32
@younusraza909
Copy link
Author

@Pudi-Sravan Updated migration file according to ,readme file .

Added triggers and updated RSL and realtime setting accordingly

Copy link
Collaborator

@Pudi-Sravan Pudi-Sravan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@younusraza909 great changes ,but there are syntax errors in your code in the file in migration and the other thing is do mention in the readme file that the code in migration can be used to create the tables with just cli instead of manual table creation as the code you wrote be generated every time supabase init is ran , so no need of a file in the directory you can just edit the Readme file.
The tables to be created be created if you have your code in that migration file only not in the one you have created .
The other thing is once again cross check the function which be triggered after a user is added.

The changes made by you are really interesting and keep working ,great work .
Kindly go through all these and commit the changes,keep it up.

@younusraza909
Copy link
Author

Hi @Pudi-Sravan
Thank you for your feedback and support.

I’ve gone through the migration file again, made some extra checks, and ran it on my Supabase database. The tables are being created without any errors. If you found any specific issues, please let me know. It’s possible I missed something, and your input would be very helpful.

About the Supabase migrations, you’re absolutely right. While supabase init sets up the project and starts migrations, it doesn’t create SQL for the tables automatically. We still need to add the SQL code ourselves to the migration file.

To make this process easier, here’s an idea:

  1. Create a text file with all the SQL commands.
  2. In the README, ask users to create a new migration using the Supabase CLI.
  3. Ask them to copy the SQL commands from the text file into the new migration and then run supabase db push.

This way, we keep things simple and avoid adding extra migration files to the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants