Skip to content

Insert ignores default values #1

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;
`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions