Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nicks's avatar
Level 3

Spark 10 migration: team_subscription_items does not exist

Hi

I am trying to migration from Spark 9 to 10. When I run my application I am getting SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db-local.team_subscription_items' doesn't exist (SQL: select * from team_subscription_items where team_subscription_items.subscription_id in (1)) (View: C:\Program Files (x86)\Ampps\www\appname\resources\views\vendor\spark\layouts\app.blade.php)

My process was to update composer.json to include:

"laravel/spark-aurelius": "~10.0",

Reading the upgrade guide, the only other things I have to do is complete actions in the Cashier upgrade guide. This talks about migrating the subscriptions table and creating a subscription_items table.

However there is nothing in either guide about creating a team_subscription_items table (and presumably migrating team_subscriptions.

Am I missing something in the migration process? Has anyone else had this problem, and, if so, how did you resolve it?

Many thanks Nick

0 likes
2 replies
bobbybouwmann's avatar
Level 88

There are some other people complaining about this as well. They solved it by creating the migration themself. It seems it's not copied correctly when upgrading.

1 like
nicks's avatar
Level 3

Thanks Bobby. I have done the same.

For the benefit of any others with this problem, the migration is:

        Schema::table('subscriptions', function (Blueprint $table) {
             $table->string('stripe_plan')->nullable()->change();
             $table->integer('quantity')->nullable()->change();
        });

        Schema::table('team_subscriptions', function (Blueprint $table) {
             $table->string('stripe_plan')->nullable()->change();
             $table->integer('quantity')->nullable()->change();
        });

        Schema::create('subscription_items', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('subscription_id');
            $table->string('stripe_id')->index();
            $table->string('stripe_plan');
            $table->integer('quantity');
            $table->timestamps();

            $table->unique(['subscription_id', 'stripe_plan']);
        });

        Schema::create('team_subscription_items', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('subscription_id');
            $table->string('stripe_id')->index();
            $table->string('stripe_plan');
            $table->integer('quantity');
            $table->timestamps();

            $table->unique(['subscription_id', 'stripe_plan']);
        });
3 likes

Please or to participate in this conversation.