Skip to content

Commit 038c727

Browse files
committed
refactor(database): rename dto to object on create table statement
1 parent 4aab9ed commit 038c727

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

packages/database/src/QueryStatements/CreateTableStatement.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,8 @@ public function json(
190190
return $this;
191191
}
192192

193-
public function dto(
194-
string $name,
195-
bool $nullable = false,
196-
?string $default = null,
197-
): self {
193+
public function object(string $name, bool $nullable = false, ?string $default = null): self
194+
{
198195
$this->statements[] = new JsonStatement(
199196
name: $name,
200197
nullable: $nullable,

tests/Integration/Database/ModelWithDtoTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function up(): QueryStatement
2929
{
3030
return CreateTableStatement::forModel(ModelWithSerializedDto::class)
3131
->primary()
32-
->dto('dto');
32+
->object('dto');
3333
}
3434

3535
public function down(): null

tests/Integration/Database/QueryStatements/CreateTableStatementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public function test_dto_field(): void
200200
public function up(): QueryStatement
201201
{
202202
return new CreateTableStatement('test_table')
203-
->dto('dto');
203+
->object('dto');
204204
}
205205

206206
public function down(): ?QueryStatement

0 commit comments

Comments
 (0)