Remove default timestamp to fix strict error (#1720)

This commit is contained in:
Donovan Schönknecht 2018-05-04 19:10:17 +02:00 committed by Mike Arpaia
parent 2482176d90
commit 12922a89cc
2 changed files with 3 additions and 3 deletions

View file

@ -12,9 +12,9 @@ func Up_20161118212641(tx *sql.Tx) error {
_, err := tx.Exec(
"CREATE TABLE `password_reset_requests` (" +
"`id` int(10) unsigned NOT NULL AUTO_INCREMENT," +
"`expires_at` timestamp NOT NULL," +
"`created_at` timestamp DEFAULT CURRENT_TIMESTAMP," +
"`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP," +
"`expires_at` timestamp NOT NULL DEFAULT '1970-01-01 00:00:01'," +
"`user_id` int(10) unsigned NOT NULL," +
"`token` varchar(1024) NOT NULL," +
"PRIMARY KEY (`id`)" +

View file

@ -8,8 +8,8 @@ import (
func (d *Datastore) NewPasswordResetRequest(req *kolide.PasswordResetRequest) (*kolide.PasswordResetRequest, error) {
sqlStatement := `
INSERT INTO password_reset_requests
( user_id, token)
VALUES (?,?)
( user_id, token, expires_at)
VALUES (?,?, NOW())
`
response, err := d.db.Exec(sqlStatement, req.UserID, req.Token)
if err != nil {