Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

sqlite3 DB schema uses datetime('now') as default which is GMT, while it should be localtime #909

@tenzap

Description

@tenzap

DB schema of gammu-smsd uses default values for date/time in SQLite3 that are stored in GMT instead of localtime.

The other databases (mysql & postgresql) already store the datetime in localtime.

This is somehow fixed in gammu-smsd with 234f630 but only for the gammu-smsd part. If anyone inserts data into the tables without setting a value of the datetime fields, the date will be GMT which is not consistent.

An example would be for example in table outbox, column InsertIntoDB. But this the case for all other columns in all tables. There the default value is set like this. NOT NULL DEFAULT (datetime('now'))
It should probably be NOT NULL DEFAULT (datetime('now', 'localtime')).

Unfortunately updating the default value of columns in sqlite3 is not supported by a single statement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions