mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Fixed battery_charge_cycles.battery_id data type
Kind of, doesn't really matter for SQLite; doesn't change anything practically
This commit is contained in:
parent
8ff8c1ac5d
commit
269ae34db3
19
migrations/0137.sql
Normal file
19
migrations/0137.sql
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
PRAGMA legacy_alter_table = ON;
|
||||||
|
|
||||||
|
ALTER TABLE battery_charge_cycles RENAME TO battery_charge_cycles_old;
|
||||||
|
|
||||||
|
CREATE TABLE battery_charge_cycles (
|
||||||
|
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
|
||||||
|
battery_id INTEGER NOT NULL,
|
||||||
|
tracked_time DATETIME,
|
||||||
|
undone TINYINT NOT NULL DEFAULT 0 CHECK(undone IN (0, 1)),
|
||||||
|
undone_timestamp DATETIME,
|
||||||
|
row_created_timestamp DATETIME DEFAULT (datetime('now', 'localtime'))
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO battery_charge_cycles
|
||||||
|
(id, battery_id, tracked_time, undone, undone_timestamp, row_created_timestamp)
|
||||||
|
SELECT id, battery_id, tracked_time, undone, undone_timestamp, row_created_timestamp
|
||||||
|
FROM battery_charge_cycles_old;
|
||||||
|
|
||||||
|
DROP TABLE battery_charge_cycles_old;
|
Loading…
x
Reference in New Issue
Block a user