LazyRecord\Migration\BaseMigration::importSchema PHP Method

importSchema() public method

public importSchema ( $schema )
    public function importSchema($schema)
    {
        $this->logger->info('Importing schema: ' . get_class($schema));
        if ($schema instanceof DeclareSchema) {
            $sqls = $this->builder->build($schema);
            $this->query($sqls);
        } elseif ($schema instanceof BaseModel && method_exists($schema, 'schema')) {
            $model = $schema;
            $schema = new DynamicSchemaDeclare($model);
            $sqls = $this->builder->build($schema);
            $this->query($sqls);
        } else {
            throw new InvalidArgumentException('Unsupported schema type');
        }
    }