﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
32132	ManyToManyField does not respect the PositiveBigIntegerField in m2m intermediate table.	Kfir Breger	David Wobrock	"When creating a relation between 2 models using PositiveBigIntegerField on Postgresql, the relation table is created using regular ints as the column type. This in turn leads to out of bound error when using large numbers for ids.

{{{
from django.contrib.gis.db import models

class Node(models.Model):
    id = models.PositiveBigIntegerField(primary_key=True)
    point = models.PointField()

class Relation(models.Model):
   id = models.PositiveBigIntegerField(primary_key=True)
   nodes = models.ManyToManyField(Node)

}}}

The generated table will look like this:
{{{
   Column    |  Type   | Collation | Nullable |                    Default                     | Storage | Stats target | Description 
-------------+---------+-----------+----------+------------------------------------------------+---------+--------------+-------------
 id          | integer |           | not null | nextval('osm_relation_nodes_id_seq'::regclass) | plain   |              | 
 relation_id | integer |           | not null |                                                | plain   |              | 
 node_id     | integer |           | not null |                                                | plain   |              | 
}}}

As you can see, the PositiveBigInteger is not respected and a regular int is set"	Bug	closed	Database layer (models, ORM)	3.1	Normal	fixed	models, orm	David Wobrock	Ready for checkin	1	0	0	0	0	0
