migrate sql:
```
ALTER TABLE posts ADD COLUMN `time` datetime NULL;
ALTER TABLE posts ADD COLUMN `title` text NULL;
ALTER TABLE posts ADD COLUMN `text` text NULL;
UPDATE posts SET
time = (SELECT a.time FROM artworks a WHERE a.id = posts.artwork_posts),
title = (SELECT a.title FROM artworks a WHERE a.id = posts.artwork_posts),
text = (SELECT a.text FROM artworks a WHERE a.id = posts.artwork_posts)
WHERE EXISTS (SELECT 1 FROM artworks a WHERE a.id = posts.artwork_posts);
ALTER TABLE artworks DROP COLUMN time;
ALTER TABLE artworks DROP COLUMN title;
ALTER TABLE artworks DROP COLUMN text;
```
configs:
add `CheckArtworkIntervalInSeconds` flag to set check artwork task interval
database:
add `migrate.sql` file
artwork:
move `time`, `title` and `text` fields to `post` schema
file:
set `id_str` and `filename` fields immutable
add `source_url` optional field
post:
set `platform` field immutable
add `time`, `title` and `text` optional from `artwork` schema
social:
set `platform` field immutable
tag:
set `text` field immutable
action(new):
add action package to create and update `file`, `post`, `social` and `tag` info
api:
artworks:
adjust GET method order option to match the database
files:
adjust GET method with `artwork/tags` edge
rename GET method respond `images` field to `files`
collect:
refactor to work with new action package
task:
artwork(new):
create `CheckArtworks` function to check and update artwork info
social:
refactor `CheckSocials` to work with new action package
router:
add `/api/task/artworks/check` endpoint for `CheckArtworks` task
src/web:
artwork noscript:
adjust order option to match the database
file noscript:
rename execute template struct `Images` field to `Files`
web:
scripts:
refactor to work with new database schema
styles:
adjust some style
use `<button>` to replace `<span>` to allow keyboard control
templates:
adjust to work with new database schema
use `<button>` to replace `<span>` to allow keyboard control
2.0 KiB
2.0 KiB