db
1<?php
2
3namespace Upside\Db\Schema;
4
5class CreateColumn extends BaseColumn
6{
7protected CreateTable $table;
8
9public function __construct(CreateTable $table, string $name, string $type)
10{
11$this->table = $table;
12
13parent::__construct($name, $type);
14}
15
16public function get_table(): CreateTable
17{
18return $this->table;
19}
20
21public function autoincrement(?string $name = null): self
22{
23$this->table->autoincrement($this, $name);
24
25return $this;
26}
27
28public function primary(?string $name = null): self
29{
30$this->table->primary($this->name, $name);
31
32return $this;
33}
34
35public function unique(?string $name = null): self
36{
37$this->table->unique($this->name, $name);
38
39return $this;
40}
41
42public function index(?string $name = null): self
43{
44$this->table->index($this->name, $name);
45
46return $this;
47}
48}
49