Giter VIP home page Giter VIP logo

Comments (5)

dolbydu avatar dolbydu commented on August 22, 2024

我也遇到了相同的问题, 楼上的, 可以在 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.

deepgully avatar deepgully commented on August 22, 2024

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.

nagatoyk avatar nagatoyk commented on August 22, 2024

这个在哪里改???

from me.

dolbydu avatar dolbydu commented on August 22, 2024

删除出错

删除 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.

deepgully avatar deepgully commented on August 22, 2024

新版本已经修复了这个问题, 需要重置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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.