database-integrity

How can MyISAM tables be used more safely?

I like InnoDB's safety, consistency, and self-checking. But I need MyISAM's speed and light weight. How can I make MyISAM less prone to corruption due to crashes, bad data, etc.? It takes forever to go through a check (either CHECK TABLE or myisamchk). I'm not asking for transactional security -- that's what InnoDB is for. But I do w...

How to fix possible db corruption?

Hi! I'm at a client doing some quick fixes to their access application. It was a while I had a go with access, but I'm recovering quickly. However, I've discovered an interesting problem: For some reports, I get a "Record is deleted" error. I've checked the reports, and it seems like there's a problem with one table. When opening that ...

SQL Server: How to make server check all its check constraints?

It seems that some scripts generated by Enterprise Manager* (or not, it doesn't matter) created check constraints WITH NOCHECK. Now when anyone modifies the table, SQL Server is stumbling across failed check constraints, and throwing errors. Can i make SQL go through all its check constraints, and check them? Running: sp_msforeachta...

How to go about catching database and software version mismatch on deployed application?

I'm developing a standalone application that accesses a common database on a server. It will be used by a few dozen people in my organization. I know that I will need to update the software and the design of the database. This creates the possibility that someone will perform a query on the database using old software. I already have...

Rails 3: Validate combined values

In Rails 2.x you can use validations to make sure you have a unique combined value like this: validates_uniqueness_of :husband, :scope => :wife In the corresponding migration it could look like this: add_index :family, [:husband, :wife], :unique => true This would make sure the husband/wife combination is unique in the database. No...

"SQLSTATE[23000]: Integrity constraint violation" in Doctrine

Hi, i do get an Integrity constraint violation for Doctrine though i really can't see why. Schema.yml User: columns: id: type: integer primary: true autoincrement: true username: type: varchar(64) notnull: true email: type: varchar(128) notnull: true password: type: var...

Django IntegrityError when saving permissions/groups via admin

Hi everyone. I'm using Django 1.0, and I'm having a tricky problem with permissions and groups. Having launched a site, I wanted to use more fine-grained permissions for the content editors, so that they can insert new content with django's built-in admin function, not having to worry about potential damage to those models they should n...

MySQL Multi-Insert? MySQL DB integrity after failed INSERT

Is it possible to insert a row into multiple tables at once? If you do several tables related by an ID; what is the best way to ensure integrity is maintained in case an INSERT fails? ...

IntegrityError with Django m2m relations

I have a relatively simple Django app, with quite heavy usage that is responsible for quite some concurrency in the db operations. I have a model Post with a m2m to a Tag model. A single line in my code, p.add(t) is repeatedly causing mysql exceptions (where p is a Post instance and t is a Tag instance.) IntegrityError: (1062, "Dupli...

Is it possible to integrate my database with a forum (SMF, phpBB) database?

I have a web application with a user base. I want to add a forum, but I don't want users to register there again. I'm using Rails/Postgresql. Is it possible to integrate the forum so that after registering in my site, a user will also be registered in a forum? Thanks ...