![](/img/trans.png)
[英]SqLite database corrupted after making an executable Jar using Eclipse
[英]Cannot restart Strapi after making changes to Content Types (using SQLite)
我遵循了 Strapi 的快速入门设置,据我所知,它设置了一个 SQLite 数据库。 我创建了一种可以正常工作的集合类型(绘画),但是每当我尝试添加新的或对现有的进行更改时,服务器不会重新启动,并且我在控制台中收到以下错误输出:
[2022-05-23 16:53:16.323] 错误:CREATE TABLE _knex_temp_alter889
( id
integer not null 主键自动增量 PRIMARY KEY AUTOINCREMENT NOT NULL, title
varchar(255) NULL, artist
varchar(255) NULL, created_at
datetime NULL, updated_at
datetime NULL, published_at
datetime NULL, created_by_id
integer NULL, updated_by_id
integer NULL, CONSTRAINT paintings_created_by_id_fk
FOREIGN KEY ( admin_users
created_by_id
id
) ON DELETE SET NULL, CONSTRAINT paintings_updated_by_id_fk
FOREIGN KEY ( updated_by_id
) REFERENCES admin_users
( id
CONSTRAINT) paintings_created_by_id_fk
FOREIGN KEY ( created_by_id
) REFERENCES admin_users
( id
) ON DELETE SET NULL, CONSTRAINT paintings_updated_by_id_fk
FOREIGN KEY ( updated_by_id
) REFERENCES admin_users
( id
) ON DELETE SET NULL) - 表“_knex_temp_alter889”有多个主键 _knex_temp: _knex_temp_alter889
id
integer not null 主键自动增量 PRIMARY KEY AUTOINCREMENT NOT NULL, title
title
varchar(255) NULL, artist
varchar(255) NULL, created_at
datetime NULL, updated_at
datetime NULL, published_at
datetime NULL, created_by_id
整数 NULL, updated_by_id
整数 NULL,约束paintings_created_by_id_fk
外键( created_by_id
)参考admin_users
( id
)ON DELETE SET NULL ,约束paintings_updated_by_id_fk
id
外键( updated_by_id
)引用admin_users
( id
) admin_users
updated_by_id
set null,限制paintings_created_by_id_fk
, created_by_id
paintings_updated_by_id_fk
admin_users
( id
) NULL) - 表“_knex_temp_alter889”有多个主键
删除我在内容类型文件中所做的更改是目前让服务器再次运行的唯一方法。 我该如何解决?
所以,我最终创建了一个新项目。 问题似乎是我添加了一个名为“ID”的字段,我认为它搞砸了一切,因为它与自动分配的 ID 系统冲突。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.