ruby - Date column in mysql table not being updated -
i have following table updating ruby script, alough fact ruby script not think relevant unless bug in mysql gem (which seems unlikely).
+---------------+---------------+------+-----+---------+-------+ | field | type | null | key | default | | +---------------+---------------+------+-----+---------+-------+ | venue_code | varchar(10) | no | mul | null | | | title | varchar(100) | no | | null | | | description | varchar(2000) | yes | | null | | | start_date | date | no | | null | | | start_time | time | yes | | null | | | date_modified | datetime | yes | | null | | | date_created | datetime | no | | null | | | url | varchar(500) | yes | | null | | | price | varchar(50) | yes | | null | | | url_ticket | varchar(500) | yes | | null | | +---------------+---------------+------+-----+---------+-------+
i running following sql using mysql.query method (again, think sql problem in case ruby thing).
insert events ( venue_code, start_date, start_time, title, price, url, url_ticket, description, date_created) values( 'olddukebri', if('2017-08-30'='',null,'2017-08-30'), if(''='',null,''), if('swampcandy'='',null,'swampcandy'), if(''='',null,''), '', if(''='',null,''), if(''='',null,''), now() )
and date not being updated '2017-08-30', being updated '0000-00-00'.
in terms of versions mysql 'mysql ver 15.1 distrib 10.0.31-mariadb, debian-linux-gnu (x86_64) using readline 5.2' , ruby 'ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]'
all on 1 regretfully appreciated. ben
Comments
Post a Comment