self-referential ManyToMany relationship column names

The algorithm to generate column names for self-referential ManyToMany relationship was changed slightly to fix ticket #69.

If you are upgrading an existing application (written using an earlier version of Elixir) and you are using self-referential ManyToMany relationships, you will get error messages like this after upgrading:

OperationalError: (OperationalError) table [table_name] has no column named bs__id 
u'INSERT INTO [table_name] (bs__id, as__id) VALUES (?, ?)' [1, 1]

or

OperationalError: (OperationalError) no such column: [table_name].is_linked_from_id
u'SELECT a.id AS a_id, a.name AS a_name 
FROM a, [table_name] 
WHERE [table_name].is_linked_from_id = ? AND [table_name].links_to_id = a.id' [2]

In that case, you might want to turn on the migration aid option so that you have warnings telling you all columns which were renamed :

from elixir import options
options.MIGRATION_TO_07_AID = True

[your classes here]

setup_all()

The next time you run your program, you will get warnings similar to these ones:

/[path]/elixir/relationships.py:1160: UserWarning: The 'a_id1' column in the 'a_links_to__a_is_linked_from' table, 
used as the intermediate table for the 'links_to' relationship on the 'A' entity 
was renamed to 'is_linked_from_id'.
  % complete_data)
/[path]/elixir/relationships.py:1160: UserWarning: The 'a_id2' column in the 'a_links_to__a_is_linked_from' table, 
used as the intermediate table for the 'is_linked_from' relationship on the 'A' entity 
was renamed to 'links_to_id'.
  % complete_data)

You have several options to fix this:

Rename the columns in the database
How this step is done depends on the database you are using. Note that some databases (notably SQLite) do not support renaming columns at all, so you might need to workaround the problem by for example, renaming the table, create a new table with the correct column names and copy data from the old table to the new table. See the test_upgrade_rename_col test for an example (source:/elixir/trunk/tests/test_m2m.py#L141).
Revert to the old format used to produce the column names
You can revert to use the old format by using the following code before you declare any of your classes:
from elixir import options
options.M2MCOL_NAMEFORMAT = options.OLD_M2MCOL_NAMEFORMAT

[your classes here]

setup_all()
Use local_colname
If you prefer, you can force Elixir to use the old name of the column on a per-relationship basis. For each warning issued, find the relationship in question, and add a "local_colname" argument using the old name of the column. For example with the two warnings above, we would use:
    links_to = ManyToMany('A', local_colname='a_id1')
    is_linked_from = ManyToMany('A', local_colname='a_id2')

bidirectional self-referential ManyToMany relationship table names

The algorithm to generate table names for bidirectional and self-referential ManyToMany relationship was changed slightly to fix ticket #19.

If you are upgrading an existing application (written using an earlier version of Elixir) and you are using self-referencial ManyToMany relationship, you are likely to get an exception like this after upgrading:

sqlalchemy.exc.OperationalError: (OperationalError) no such table: [table_name]
u'INSERT INTO [table_name] (column1, column2) VALUES (?, ?)' [[5, 6], [6, 5]]

You might want to output warnings for all tables which have changed name (and are potentially wrong):

from elixir import options
options.MIGRATION_TO_07_AID = True

[your classes here]

setup_all()

local_side and remote_side arguments on ManyToMany relationships renamed to local_colname and remote_colname

You simply need to update your code to match the new names.

Deprecated act_as_list extension

You should use SQLAlchemy's orderinglist extension instead. See wiki:Recipes/UsingEntityForOrderedList for an example using Elixir.