Skip to content

Migrations fail for new installs #1810

@yoeriboven

Description

@yoeriboven

Cashier Stripe Version

16.0

Laravel Version

12.40.2

PHP Version

8.4.14

Database Driver & Version

MySQL

Description

When you run the migrations they will be executed alphabetically like this:

2025_12_01_101217_add_meter_event_name_to_subscription_items_table.php
2025_12_01_101217_add_meter_id_to_subscription_items_table.php
2025_12_01_101217_create_customer_columns.php
2025_12_01_101217_create_subscription_items_table.php
2025_12_01_101217_create_subscriptions_table.php

This will fail because in the first migration it expects the subscription_items table to exist which at that point has not been created yet.

Migrations in the package are currently sorted by the timestamp but that is overwritten when you publish.

Possible solution

Add a prefix to the migration names like:

2019_05_03_000001_1_create_customer_columns.php

Steps To Reproduce

Create a new laravel app
Install Cashier
Publish migrations
Run migrations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions