Error When Trying to Add Columns to The Users Table Schema
Hey Everyone! I'm trying to setup my database and add a few extra columns under the users table in the wave database migration schema. However, I am running into an error where it says the 'subscriptions' table does not exist when I run php artisan migrate or php artisan migrate: rollback. When I check my schema on MySQL Workbench, I also don't see the subscriptions table built at all. Is there something wave is doing behind the scenes that I'm missing?
Attaching the error for reference:
List of current tables:
Hey!
That is quite interesting, is this a new Wave project or an existing one and are you running the latest Wave changes from the main branch?
For some context, the subscriptions
table is a legacy table from Wave v1 and it was used for the Stripe integration but since then Wave v2 has moved to Paddle so that table subscriptions
is not really needed and that is why in the migration that you are seeing the error in the table is being dropped.
You could try changing this line here:
https://github.com/thedevdojo/wave/blob/main/wave/database/migrations/2021_01_28_182638_removing_cashier_sub_tables.php#L17
From:
Schema::drop('subscriptions');
To:
Schema::dropIfExists('subscriptions');
And this should fix that error that you are seeing. Let me know how it goes!
Hey @bobbyiliev thanks for responding! So I upgraded my repos migration files with the latest one on the wave GitHub repo and then fixed the subscriptions table error. I am running into a different error now with the 'slugs' column? Also is there any documentation to familiarize/learn about what all these tables and fields are being used for inside of Wave?
Hi there,
If you already have the slug column in the plans table, you could delete that migrations file: wave/database/migrations/2021_01_29_173720_add_slug_column_to_plans_table.php
.
I don't think that every single column has explicit documentation, but the best place to check what each column and table is used for is the code itself. Or if you have any questions about a specific table or column you can ask them here.
In this case:
- The
plans
table is used to store the individual plans that you create for your project. Each plan has:id
: The unique ID of the planname
: The name of the plan, this is what the user will seeslug
: The unique slug of the plandescription
: The description of the planfeatures
: The list of the features of the planplan_id
: The ID of the plan in Paddlerole_id
: The ID of the role associated with the planprice
: The price of the plantrial_days
: How many days the trial lastscreated_at
: When the plan was createdupdated_at
: When the plan was updated
In most cases the names of the tables and the columns should be self descriptive.
Let me know if you have any quesitons.