- Migrated Entity's file into attributes
This commit is contained in:
1 parent
fa8adcace1
commit
43880eb428
4 files changed
+77
-191
No files matched your search
@@ -5,131 +5,84 @@ namespace Ulmus\Entity\InformationSchema;
|
||||
use Ulmus\EntityCollection,
|
||||
Ulmus\Entity\Field\Datetime;
|
||||
|
||||
/**
|
||||
* @Table('name' => "tables", 'database' => "information_schema")
|
||||
*/
|
||||
use Ulmus\{Attribute\Obj\Table as TableObj};
|
||||
use Ulmus\Attribute\Property\{Field, Filter, FilterJoin, Relation, Join, Virtual, Where};
|
||||
|
||||
#[TableObj(name: "tables", database: "information_schema")]
|
||||
class Table
|
||||
{
|
||||
use \Ulmus\EntityTrait;
|
||||
|
||||
/**
|
||||
* @Field('name' => "TABLE_CATALOG", 'length' => 512)
|
||||
*/
|
||||
#[Field(name: "TABLE_CATALOG", length: 512)]
|
||||
public string $catalog;
|
||||
|
||||
/**
|
||||
* @Field('name' => "TABLE_SCHEMA", 'length' => 64)
|
||||
*/
|
||||
#[Field(name: "TABLE_SCHEMA", length: 64)]
|
||||
public string $schema;
|
||||
|
||||
/**
|
||||
* @Field('name' => "TABLE_NAME", 'length' => 64, 'attributes' => [ 'primary_key' => true ])
|
||||
*/
|
||||
#[Field(name: "TABLE_NAME", length: 64, attributes: [ 'primary_key' => true, ])]
|
||||
public string $name;
|
||||
|
||||
/**
|
||||
* @Field('name' => "TABLE_TYPE", 'length' => 64)
|
||||
*/
|
||||
#[Field(name: "TABLE_TYPE", length: 64)]
|
||||
public string $type;
|
||||
|
||||
/**
|
||||
* @Field('name' => "ENGINE", 'length' => 64)
|
||||
*/
|
||||
#[Field(name: "ENGINE", length: 64)]
|
||||
public ? string $engine ;
|
||||
|
||||
/**
|
||||
* @Field('name' => "VERSION", 'type' => "bigint", 'length' => 21, 'attributes' => [ 'unsigned' => true ])
|
||||
*/
|
||||
#[Field(name: "VERSION", type: "bigint", length: 21, attributes: [ 'unsigned' => true, ])]
|
||||
public ? string $version;
|
||||
|
||||
/**
|
||||
* @Field('name' => "ROW_FORMAT", 'length' => 10)
|
||||
*/
|
||||
#[Field(name: "ROW_FORMAT", length: 10)]
|
||||
public ? string $rowFormat;
|
||||
|
||||
/**
|
||||
* @Field('name' => "TABLE_ROWS", 'type' => "bigint", 'length' => 21, 'attributes' => [ 'unsigned' => true ])
|
||||
*/
|
||||
#[Field(name: "TABLE_ROWS", type: "bigint", length: 21, attributes: [ 'unsigned' => true, ])]
|
||||
public ? string $rows;
|
||||
|
||||
/**
|
||||
* @Field('name' => "AVG_ROW_LENGTH", 'type' => "bigint", 'length' => 21, 'attributes' => [ 'unsigned' => true ])
|
||||
*/
|
||||
#[Field(name: "AVG_ROW_LENGTH", type: "bigint", length: 21, attributes: [ 'unsigned' => true, ])]
|
||||
public ? string $averageRowLength;
|
||||
|
||||
/**
|
||||
* @Field('name' => "DATA_LENGTH", 'type' => "bigint", 'length' => 21, 'attributes' => [ 'unsigned' => true ])
|
||||
*/
|
||||
#[Field(name: "DATA_LENGTH", type: "bigint", length: 21, attributes: [ 'unsigned' => true, ])]
|
||||
public ? string $dataLength;
|
||||
|
||||
/**
|
||||
* @Field('name' => "MAX_DATA_LENGTH", 'type' => "bigint", 'length' => 21, 'attributes' => [ 'unsigned' => true ])
|
||||
*/
|
||||
#[Field(name: "MAX_DATA_LENGTH", type: "bigint", length: 21, attributes: [ 'unsigned' => true, ])]
|
||||
public ? string $maxDataLength;
|
||||
|
||||
/**
|
||||
* @Field('name' => "INDEX_LENGTH", 'type' => "bigint", 'length' => 21, 'attributes' => [ 'unsigned' => true ])
|
||||
*/
|
||||
#[Field(name: "INDEX_LENGTH", type: "bigint", length: 21, attributes: [ 'unsigned' => true, ])]
|
||||
public ? string $indexLength;
|
||||
|
||||
/**
|
||||
* @Field('name' => "DATA_FREE", 'type' => "bigint", 'length' => 21, 'attributes' => [ 'unsigned' => true ])
|
||||
*/
|
||||
#[Field(name: "DATA_FREE", type: "bigint", length: 21, attributes: [ 'unsigned' => true, ])]
|
||||
public ? string $dataFree;
|
||||
|
||||
/**
|
||||
* @Field('name' => "AUTO_INCREMENT", 'type' => "bigint", 'length' => 21, 'attributes' => [ 'unsigned' => true ])
|
||||
*/
|
||||
#[Field(name: "AUTO_INCREMENT", type: "bigint", length: 21, attributes: [ 'unsigned' => true, ])]
|
||||
public ? string $autoIncrement;
|
||||
|
||||
/**
|
||||
* @Field('name' => "CREATE_TIME")
|
||||
*/
|
||||
#[Field(name: "CREATE_TIME")]
|
||||
public ? Datetime $createTime;
|
||||
|
||||
/**
|
||||
* @Field('name' => "UPDATE_TIME")
|
||||
*/
|
||||
#[Field(name: "UPDATE_TIME")]
|
||||
public ? Datetime $updateTime;
|
||||
|
||||
/**
|
||||
* @Field('name' => "CHECK_TIME")
|
||||
*/
|
||||
#[Field(name: "CHECK_TIME")]
|
||||
public ? Datetime $checkTime;
|
||||
|
||||
/**
|
||||
* @Field('name' => "TABLE_COLLATION", 'length' => 32)
|
||||
*/
|
||||
#[Field(name: "TABLE_COLLATION", length: 32)]
|
||||
public ? string $tableCollation;
|
||||
|
||||
/**
|
||||
* @Field('name' => "CHECKSUM", 'type' => "bigint", 'length' => 21, 'attributes' => [ 'unsigned' => true ])
|
||||
*/
|
||||
#[Field(name: "CHECKSUM", type: "bigint", length: 21, attributes: [ 'unsigned' => true, ])]
|
||||
public ? string $checksum;
|
||||
|
||||
/**
|
||||
* @Field('name' => "CREATE_OPTIONS", 'length' => 2048)
|
||||
*/
|
||||
#[Field(name: "CREATE_OPTIONS", length: 2048)]
|
||||
public ? string $createOptions;
|
||||
|
||||
/**
|
||||
* @Field('name' => "TABLE_COMMENT", 'length' => 2048)
|
||||
*/
|
||||
#[Field(name: "TABLE_COMMENT", length: 2048)]
|
||||
public string $tableComment;
|
||||
|
||||
/**
|
||||
* @Field('name' => "MAX_INDEX_LENGTH", 'type' => "bigint", 'length' => 21, 'attributes' => [ 'unsigned' => true ])
|
||||
*/
|
||||
#[Field(name: "MAX_INDEX_LENGTH", type: "bigint", length: 21, attributes: [ 'unsigned' => true, ])]
|
||||
public ? int $maxIndexLength;
|
||||
|
||||
/**
|
||||
* @Field('name' => "TEMPORARY", 'length' => 1)
|
||||
*/
|
||||
#[Field(name: "TEMPORARY", length: 1)]
|
||||
public ? string $temporary;
|
||||
|
||||
/**
|
||||
* @Relation('oneToMany', 'key' => 'name', 'foreignKey' => Column::field('tableName'), 'entity' => Column::class)
|
||||
* @Where('TABLE_SCHEMA', Column::field('tableSchema'))
|
||||
*/
|
||||
#[Relation(type: "oneToMany", key: "name", foreignKey: [ Column::class, 'tableName' ], entity: Column::class)]
|
||||
#[Where('TABLE_SCHEMA', [ Column::class, 'tableSchema' ])]
|
||||
public EntityCollection $columns;
|
||||
}
|
||||
Reference in new issue
Block a user