PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Question By

Unsolved

Error When Trying to Add Columns to The Users Table Schema

elkinkm97

Dec 14th, 2022 07:20 PM

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: Screen Shot 2022-12-14 at 7.16.42 PM.png

List of current tables: Screen Shot 2022-12-14 at 7.17.09 PM.png

bobbyiliev

Dec 15th, 2022 12:23 AM

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!

elkinkm97

Dec 15th, 2022 08:21 PM

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?

Screen Shot 2022-12-15 at 8.17.56 PM.png

bobbyiliev

Dec 16th, 2022 01:13 AM

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 plan
    • name: The name of the plan, this is what the user will see
    • slug: The unique slug of the plan
    • description: The description of the plan
    • features: The list of the features of the plan
    • plan_id: The ID of the plan in Paddle
    • role_id: The ID of the role associated with the plan
    • price: The price of the plan
    • trial_days: How many days the trial lasts
    • created_at: When the plan was created
    • updated_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.