PDA

View Full Version : Database schema changes with MySQL



adhawkins
2006-01-10, 06:26
Hi,

I've just switched my slimserver over to MySQL. However, a thought occurred:
what happens when I do an update that requires a database scheme change?
Will the new schema be applied automatically, or will I need to do
something?

When I switched over, I imported the MySQL schema into the database myself.
Was this un-necessary or would slimserver have created the database tables
itself?

Thanks

Andy

Browny
2006-01-10, 07:15
When Slimserver connects to the db for the first time it automatically runs the dbcreate.sql for you and starts a scan.

There is also the metainformation table that holds details about what version of the database it is.

adhawkins
2006-01-10, 08:33
In article <Browny.21fa7b (AT) no-mx (DOT) forums.slimdevices.com>,
Browny<Browny.21fa7b (AT) no-mx (DOT) forums.slimdevices.com> wrote:
> When Slimserver connects to the db for the first time it automatically
> runs the dbcreate.sql for you and starts a scan.

Ok, so my initial import of the schema was un-necessary.

> There is also the metainformation table that holds details about what
> version of the database it is.

Does that mean that if a new version of slimserver comes out with a new
database version, then the new schema will be applied automatically?

Thanks

Andy

Browny
2006-01-10, 12:25
Does that mean that if a new version of slimserver comes out with a new
database version, then the new schema will be applied automatically? ...

Yes should do. Each release of the database comes with an upgrade script that get applied when Slimserver starts. Normally this script is just incrementing the version number, but occasionally the structure of the tables may change.

adhawkins
2006-01-10, 13:17
Hi,

In article <Browny.21fojz (AT) no-mx (DOT) forums.slimdevices.com>,
Browny<Browny.21fojz (AT) no-mx (DOT) forums.slimdevices.com> wrote:
> Yes should do. Each release of the database comes with an upgrade
> script that get applied when Slimserver starts. Normally this script
> is just incrementing the version number, but occasionally the structure
> of the tables may change.

Excellent, just what I wanted to know.

Thanks

Andy