Tricks and tips Administering DrawMGT

General Tips and Tricks

How to permanently remove large files from a Git repository

This explains how to permanently delete files from a git repository. This would be necessary if yo uchecked in a large file by accident and don't want other developer to have to download the entire history, including the deleted file.

Example Problem

  1. Your local development repository is at /home/user/projects/v2p0
  2. The server repository is at git.softxs.ch://home/git/gitroot/v2p0.git
  3. You accidentally committed a sub-tree full of files into v2p0 at public/assets

Procedure

  1. Create a temporary repository
  2. Remove entire sub-directory and its history with the git filter-branch command

  3. Clone the result into a new (clean) local git repository
  4. Replace the git repository on the git server with the new clean repository

Create a temporary repository

Remove entire sub-directory and its history with the git filter-branch command

Clone the result into a new (clean) local git repository

Replace the git repository on the git server whith the new clean repository

DrawMGT Tips and Tricks

How to regenerate all thumbnails

Assumed all thumbnails should be regenerated:

$ cd pub/thumbnails
$ rm *
mysql -uroot -psqladmin {database}
mysql> update Revisions set sourceThumbnail = null, publishThumbnail = null, file3Thumbnail = null, file4Thumbnail = null, file5Thumbnail = null, file6Thumbnail = null;
mysql> update Events set stateId = 3, attemptNo = null, runDatetime = null where objectTypeId = 2 and eventTypeId = 24;

After the database changes the Event Daemon will regenerate the thumbnail files.

How to recreate database triggers after database changes

If it is necessary to recreate database triggers after database changes must be ensured that the triggers will have the same character set settings as the database. Otherwise unpredictable behavior can occur (every time a trigger is called, than 'show variables like "character_set_results";' reports changed character set). The achieve this , don't forget to use the "set names ..." command. Assumed the database is hcmc2140test and the character set is utf8:

$ cd {project root}
$ mysql -uroot -psqladmin hcmc2140test
mysql> set names utf8;
mysql> source var/hcmc2/zg.softxs.ch-test/schema/drawmgt-versioning-schema.sql
mysql> source var/hcmc2/zg.softxs.ch-test/schema/drawmgt-versioning-trigger.sql

Trigger character set can be checked with the command:

mysql> select EVENT_OBJECT_TABLE, TRIGGER_NAME, CHARACTER_SET_CLIENT, COLLATION_CONNECTION, DATABASE_COLLATION from information_schema.TRIGGERS where EVENT_OBJECT_SCHEMA = 'hcmc2140prod' [ and TRIGGER_NAME = 'upd_Users' ];

Database character set can be checked with the command:

mysql> select SCHEMA_NAME, DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME from information_schema.SCHEMATA [ where SCHEMA_NAME = 'hcmc2140test' ];

Table character set can be checked with the command:

mysql> select TABLE_COLLATION from information_schema.TABLES where TABLE_SCHEMA = 'linthal140dev1' [ and TABLE_NAME = 'Drawings' ];

TipsAndTricks (last edited 2013-02-04 19:33:18 by 10)

Copyright 2008-2014, SoftXS GmbH, Switzerland