Skip to content

Insert ignores default values #1

@NiklasAurora

Description

@NiklasAurora

Issue: If I insert a new user into my database, DEFAULT values set in MySQL is ignored and value is set to NULL.

Environment:
PHP 7.1.8
mysql Ver 14.14 Distrib 5.7.19, for osx10.13 (x86_64) using EditLine wrapper
anax/database v1.1.4

Following test example was used in SQL:
`
DROP TABLE IF EXISTS User;

CREATE TABLE User (
id INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL,
username VARCHAR(80) UNIQUE NOT NULL,
mail VARCHAR(100) UNIQUE NOT NULL,
password VARCHAR(255) NOT NULL,
admin INTEGER DEFAULT 0,
created DATETIME,
updated DATETIME,
deleted DATETIME,
active DATETIME
) ENGINE INNODB CHARACTER SET utf8 COLLATE utf8_swedish_ci;
`

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions