Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > cfb52b416d6e5f2dd37b8b303b69c89c > files > 589

bibus-1.4.3-2.1mdv2008.1.x86_64.rpm

In Bibus pre1.0.0a, I introduced the possibility to freely edit the Identifier.
Before pre1.0.0a, the uniqueness of the identifier was ensured by adding #Id
after the Identifier where Id was a unique number generated by the database engine.
This is no more the case.
To ensure uniqueness of the Identifier I have changed the definition of the column
Identifier by adding the constrain 'UNIQUE'

This has been done in Bibus 0.9
If your database has been created by Bibus >= 0.9, you can still use it with Bibus pre1.0.0a.
To be sure it is ok, look at point 1 below

If your database has been created with Bibus < 0.9 you have to update your database.
Look at point 2 below

1) Checking if the database is OK
---------------------------------

a) Method 1
The simplest method is to use Bibus-pre1.0.0a:
- open your database in Bibus
- double click on a reference
- check the "Edit Identifier" checkbox
- change the Identifier to an already used Identifier
- Click OK
- Bibus should Warn you that the Identifier is in use
and should change it to a new unique value (Identifier#Id)

If it is not the case, you should have now 2 identical identifiers
Change it back to the correct value and go to point 2

b) Method 2 - sqlite

prompt> sqlite <your database>
sqlite> .schema bibref
You should get something like:
"create table bibref (Id INTEGER PRIMARY KEY,Identifier UNICODE UNIQUE,BibliographicType INTEGER N ...."
Notice the UNIQUE keyword after "Identifier UNICODE"
If it is not there, go to point 2

c) Method 2 - mysql

prompt> mysql -p
mysql> use Biblio
mysql> describe bibref;
You should get:
+-------------------+---------------------+------+-----+---------+----------------+
| Field             | Type                | Null | Key | Default | Extra          |
+-------------------+---------------------+------+-----+---------+----------------+
| Id                | int(10) unsigned    |      | PRI | NULL    | auto_increment |
| Identifier        | varchar(255)        | YES  | MUL | NULL    |                |
| BibliographicType | tinyint(3) unsigned |      |     | 0       |                |
| Address           | varchar(255)        |      |     |         |                |
....
If there is MUL in the Key column for identifier, your database is OK, otherwise go to 2


2) Updating an old database:
----------------------------

a) sqlite
---------

- make a copy of your database as backup
- In the same directory, copy:
    * your database
    * the file <Bibus>/Docs/db_models/savedata.sqlite
    * the file <Bibus>/Docs/db_models/sqlite.sql
- at the prompt type:

prompt> cat savedata.sqlite | sqlite <your database> | sqlite <new database>


b) MySQL
--------
Depending on your access rights you may need to use mysql-root access to perform
the database modification.

- make a backup of your database:
     prompt> mysqldump -p Biblio > saveddata.sql
- update the database (database name = Biblio):
     prompt> mysql -p Biblio < <Bibus>/Docs/db_models/mysql.sql
     prompt> mysql -p Biblio < saveddata.sql