Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
58b43c22
Commit
58b43c22
authored
18 years ago
by
Patrick Meidl
Browse files
Options
Downloads
Patches
Plain Diff
schema loading and patch procedure documentation
parent
67a324dc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sql/README
+74
-0
74 additions, 0 deletions
sql/README
with
74 additions
and
0 deletions
sql/README
0 → 100755
+
74
−
0
View file @
58b43c22
*** Ensembl database schema ***
This documents describes how to load the Ensembl database schema and to use the
patches to keep your schema up-to-date between releases.
1. Creating an empty Ensembl db from scratch:
=============================================
The Ensembl database schema is defined in the file ensembl/sql/tables.sql. Use
the mysql commandline client to load this schema into a new database:
a. log into your MySQL database server and create a new database.
b. load the schema into this database:
$ mysql -h mysql_host -P 3306 -u your_username -pyour_password \
new_ensembl_db < ensembl/sql/tables.sql
2. Patching an existing Ensembl database to the latest schema:
==============================================================
For each release, the core team provides patches to bring your databases to the
latest schema. Before release 39, there was a single patch file for each
release. From release 39, the patches will be split into multiple files, each
containing one "task". The new convention for patch files (to be found in
ensembl/sql) is:
release < 39: patch_FROM_TO.sql
release >= 39: patch_FROM_TO_[a-z].sql
where FROM is the schema version before patching, TO the version to
patch to, and [a-z] is a letter specifying the respective patch.
Each patch will put an entry into the meta table (meta_key = 'patch') to
indicate that it has been applied successfully.
This meta information is also used by the patch script to determine which
patches need to be applied to a db. The patch script is
ensembl/misc-scripts/schema_patch.pl, run with --help to see all options it
accepts (from the commandline or from an ini-style configuration file passed in
with --conffile). You can patch multiple database at a time by using an
appropriate --pattern.
Note that you can still apply the patches manually if you prefer.
a. Find out the schema version of your db(s):
---------------------------------------------
Look at the 'schema_version' entry in the meta table to find out the current
schema version of your db. You will have to apply all patches from this to the
current version sequentially, e.g. if you version is 36 and you want to patch to
39, you'll have to apply patches 36->37, 37->38 and 38->39.
b. Check which patches need to be applied:
------------------------------------------
This step is optional, you can proceed to step (c) immediately if you like.
$ ensembl/misc-scripts/schema_patch.pl --host mysql_host --port 3306 \
--user your_username --pass your_password --pattern %_core_39_% \
--schema 39 --dry_run 1 --interactive 0
c. Actually patch the databases:
--------------------------------
$ ensembl/misc-scripts/schema_patch.pl --host mysql_host --port 3306 \
--user your_username --pass your_password --pattern %_core_39_% \
--schema 39 --logfile /your/log/path/schema_patch.39.log
The script will run interactively and prompt you for each database matching the
pattern. --logfile is optional but useful for keeping track of what you've done.
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment