Skip to content

Commit beb2fd0

Browse files
committed
refactor: use new migration format
1 parent 62bced9 commit beb2fd0

File tree

2 files changed

+6
-26
lines changed

2 files changed

+6
-26
lines changed

tests/Integration/Database/EncryptedAttributeTest.php

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
use PHPUnit\Framework\Attributes\Test;
66
use Tempest\Cryptography\Encryption\Encrypter;
7-
use Tempest\Database\DatabaseMigration;
87
use Tempest\Database\Encrypted;
98
use Tempest\Database\IsDatabaseModel;
9+
use Tempest\Database\MigratesUp;
1010
use Tempest\Database\Migrations\CreateMigrationsTable;
1111
use Tempest\Database\PrimaryKey;
1212
use Tempest\Database\Query;
@@ -127,7 +127,7 @@ public function __construct(
127127
) {}
128128
}
129129

130-
final class CreateUserWithEncryptedDataTable implements DatabaseMigration
130+
final class CreateUserWithEncryptedDataTable implements MigratesUp
131131
{
132132
public string $name = '2024_create_users_with_encrypted_data_table';
133133

@@ -138,14 +138,9 @@ public function up(): CreateTableStatement
138138
->string('email')
139139
->text('secret');
140140
}
141-
142-
public function down(): null
143-
{
144-
return null;
145-
}
146141
}
147142

148-
final class CreateUserWithNullableEncryptedDataTable implements DatabaseMigration
143+
final class CreateUserWithNullableEncryptedDataTable implements MigratesUp
149144
{
150145
public string $name = '2024_create_users_with_nullable_encrypted_data_table';
151146

@@ -156,9 +151,4 @@ public function up(): CreateTableStatement
156151
->string('email')
157152
->text('secret', nullable: true);
158153
}
159-
160-
public function down(): null
161-
{
162-
return null;
163-
}
164154
}

tests/Integration/Database/HashedAttributeTest.php

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
use PHPUnit\Framework\Attributes\Test;
66
use Tempest\Cryptography\Password\PasswordHasher;
7-
use Tempest\Database\DatabaseMigration;
87
use Tempest\Database\Hashed;
98
use Tempest\Database\IsDatabaseModel;
9+
use Tempest\Database\MigratesUp;
1010
use Tempest\Database\Migrations\CreateMigrationsTable;
1111
use Tempest\Database\PrimaryKey;
1212
use Tempest\Database\QueryStatements\CreateTableStatement;
@@ -115,7 +115,7 @@ public function __construct(
115115
) {}
116116
}
117117

118-
final class CreateUserWithHashTable implements DatabaseMigration
118+
final class CreateUserWithHashTable implements MigratesUp
119119
{
120120
public string $name = '2024_create_users_table';
121121

@@ -126,14 +126,9 @@ public function up(): CreateTableStatement
126126
->varchar('email')
127127
->text('password');
128128
}
129-
130-
public function down(): null
131-
{
132-
return null;
133-
}
134129
}
135130

136-
final class CreateUserWithNullablePasswordTable implements DatabaseMigration
131+
final class CreateUserWithNullablePasswordTable implements MigratesUp
137132
{
138133
public string $name = '2024_create_users_with_nullable_password_table';
139134

@@ -144,9 +139,4 @@ public function up(): CreateTableStatement
144139
->varchar('email')
145140
->text('password', nullable: true);
146141
}
147-
148-
public function down(): null
149-
{
150-
return null;
151-
}
152142
}

0 commit comments

Comments
 (0)