yii2mod / yii2-cashier

Yii2 Cashier provides an interface to Stripe's subscription billing services.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Migrations must have table prefix

gogl92 opened this issue · comments

Migrations doesn't consider table prefix if exist, should be changed to this

{{%subscription}} and {{%user}}

        $this->createTable('{{%subscription}}', [
            'id' => $this->primaryKey(),
            'userId' => $this->integer()->notNull(),
            'name' => $this->string()->notNull(),
            'stripeId' => $this->string()->notNull(),
            'stripePlan' => $this->string()->notNull(),
            'quantity' => $this->integer()->notNull(),
            'trialEndAt' => $this->timestamp()->null(),
            'endAt' => $this->timestamp()->null(),
            'createdAt' => $this->timestamp()->null(),
            'updatedAt' => $this->timestamp()->null(),
        ], $tableOptions);

        $this->addColumn('{{%user}}', 'stripeId', $this->string());
        $this->addColumn('{{%user}}', 'cardBrand', $this->string());
        $this->addColumn('{{%user}}', 'cardLastFour', $this->string());
        $this->addColumn('{{%user}}', 'trialEndAt', $this->timestamp()->null());
    }

    public function down()
    {
        $this->dropTable('subscription');

        $this->dropColumn('{{%user}}', 'stripeId');
        $this->dropColumn('{{%user}}', 'cardBrand');
        $this->dropColumn('{{%user}}', 'cardLastFour');
        $this->dropColumn('{{%user}}', 'trialEndAt');
    }

Hi, Can you upgrade your package? I have added it's already.

Oh I see what the problem is: it is on the master the prefix but is not on the last release.
I will try with dev-master

I have created the new release - 1.6, please update your package.