| Conditions | 1 |
| Paths | 1 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function up(): void |
||
| 26 | { |
||
| 27 | Schema::create('versions', static function (Blueprint $table) { |
||
| 28 | $table->{config('versionable.key_type', 'unsignedBigInteger')}('id') |
||
| 29 | ->primary(); |
||
| 30 | $table->unsignedBigInteger('version_number'); |
||
| 31 | $table->{config('versionable.user_key_type', 'unsignedBigInteger')}( |
||
| 32 | config('versionable.user_foreign_key', 'user_id') |
||
| 33 | ); |
||
| 34 | $table->string('versionable_id'); |
||
| 35 | $table->string('versionable_type'); |
||
| 36 | $table->json('contents')->nullable(); |
||
| 37 | $table->timestamps(); |
||
| 38 | |||
| 39 | $table->unique( |
||
| 40 | ['versionable_id', 'versionable_type', 'version_number'], |
||
| 41 | 'unique_version_for_model' |
||
| 42 | ); |
||
| 43 | }); |
||
| 44 | } |
||
| 45 | |||
| 54 |