+
Skip to content

SQLITE migrations #36

@ghost

Description

Having an issue with sqlite and migrations, I create the entity, get the mapper, run the migrate(),
no posts table in my db. Here is the code. The db is there and it has correct perms and traditional PDO things work. Also I am not getting any fails or message in error log. So maybe you see something, maybe it works in MySql but not in SQLITE?. At any rate this is a very promising project to help with our projects here.

$cfg = new \Spot\Config();
// Sqlite
$cfg->addConnection('sqlite', 'sqlite://db/database.sqlite' );
$spot = new \Spot\Locator($cfg);

$mapper = $spot->mapper('Entity\Post');
$mapper->migrate();

And the entity

['type' => 'integer', 'primary' => true, 'autoincrement' => true], 'title' => ['type' => 'string', 'required' => true], 'body' => ['type' => 'text', 'required' => true], 'status' => ['type' => 'integer', 'default' => 0, 'index' => true], 'author_id' => ['type' => 'integer', 'required' => true], 'date_created' => ['type' => 'datetime', 'value' => new \DateTime()] ]; } ``` }

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载