Comments (5)
我也遇到了相同的问题, 楼上的, 可以在 bae 界面数据库里手动删除, 不过我确信这不是一个好方法. 希望 gully 能解决下
(IntegrityError) (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (数据库名不告诉你
.db_post
, CONSTRAINT db_post_ibfk_1
FOREIGN KEY (_stats_id
) REFERENCES db_stats
(id
))') 'DELETE FROM db_stats WHERE db_stats.id = %s' (9L,)
from me.
http://demo.me.deepgully.com 一切正常啊, 删除post和删除photo都没问题,这个问题我记得之前修复过一次
_stats_id = db.Column(db.Integer, db.ForeignKey(DBStats.tablename + '.id', ondelete="SET NULL"))
把ondelete设成SET NULL解决了这个问题.
#6
可以再详细描述一下出错的情况吗?
from me.
这个在哪里改???
from me.
删除出错
删除 timeline 的 post 时候提示
(IntegrityError) (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (eWHsNwFSpRLYYtWMgUzv
.db_post
, CONSTRAINT db_post_ibfk_1
FOREIGN KEY (_stats_id
) REFERENCES db_stats
(id
))') 'DELETE FROM db_stats WHERE db_stats.id = %s' (17L,)
删除 photo 的 album 时候提示
(IntegrityError) (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (eWHsNwFSpRLYYtWMgUzv
.db_photo
, CONSTRAINT db_photo_ibfk_1
FOREIGN KEY (_stats_id
) REFERENCES db_stats
(id
))') 'DELETE FROM db_stats WHERE db_stats.id = %s' (16L,)
操作系统 XP, 浏览器 chrome
操作系统 ubuntu, 浏览器 firefox
均无法删除
上传照片 出错
另外 我使用 ubuntu + firefox 的时候没办法上传图片
借同学的电脑切换 windows xp 和 windows 7 的时候上传很正常
我暂时找不到第二台 linux 机器,
所以问下 gully 兄有没有可能是在程序中使用了
这样的路径 "\Program Files\Photo\x.jpg" 之类的
在 Linux 下 路径是 "~/dobby/home/x.jpg"
最好还是用 pathjoin 这样的
当然也有可能是我电脑有问题 装开发库太多了
一个小请求
最后来表扬下哈 您的这个程序真太漂亮了
咱的小网站
我想在扉页上加一个留言板,
不需要登录就能留言的,
然后我可以删除管理那种.
希望您能给做出来,
当然要是你很忙的话,
请告诉我要改哪里..
我也想自己试试改改..
from me.
新版本已经修复了这个问题, 需要重置bae的数据库
如果想保留之前的数据库,请手动在PhpMyAdmin里面执行:
ALTER TABLE `db_post`
DROP FOREIGN KEY `db_post_ibfk_1`;
ALTER TABLE `db_post`
ADD CONSTRAINT `db_post_ibfk_1` FOREIGN KEY (`_stats_id`)
REFERENCES `db_stats` (`id`) ON DELETE SET NULL;
ALTER TABLE `db_photo`
DROP FOREIGN KEY `db_photo_ibfk_1`;
ALTER TABLE `db_photo`
ADD CONSTRAINT `db_photo_ibfk_1` FOREIGN KEY (`_stats_id`)
REFERENCES `db_stats` (`id`) ON DELETE SET NULL;
from me.
Related Issues (20)
- 可以在linux vps上安装吗? HOT 1
- 换行问题 HOT 1
- 关于隐藏设置问题 HOT 3
- 使用七牛云存储上传图片错误 HOT 2
- 请问之后能否加入以下功能 HOT 1
- 给一个本地配置的教程呗 HOT 1
- 上传GAE后无法登陆 HOT 1
- 为什么按照配置SAE之后每次访问都会弹出svn认证弹窗 HOT 1
- New Feature写博客页面增加自动保存功能
- list模式下当分辨率width大于1887的时候,右侧列表自动窜到了左侧
- 在sae上无法新建文章? HOT 2
- BUG?新建类别之后不能编辑或删除吗? HOT 1
- 网站启用https的问题
- bae上部署失败啊
- twitter handle
- CCGen
- Tags not update when delete a post
- 亲,程序clone下后运行不了
- 当页面有较多图片时,会超级吃内存 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from me.