Ticket #29182: bug_repro.sh

File bug_repro.sh, 990 bytes (added by ezaquarii, 6 years ago)

Bug reproduction steps as shell script

Line 
1#!/bin/sh
2
3# Steps to reproduce the bug
4# 1. build the project
5# 2. run bootstrap to initialize the database
6# 3. during bootstrap db migrations is run via call_command('migrate'):
7# - openvpn_server table is created
8# - openvpn_client table is created; it uses foreign key to openvpn_server
9# - openvpn_server table is renamed to openvpn_server__old
10# - openvpn_client foreign key is re-linked to openvpn_server__old
11# - openvpn_server is created and data from openvpn_server__old is copied
12# - openvpn_server__old is dropped
13# - openvpn_client still references openvpn_sever__old - ForeignKey constraint is not updated
14# 3. try creating Client object - SQL cannot be executed
15
16make devel
17cd backend
18source ./env/bin/activate
19./manage.py bootstrap
20
21echo '
22Now type that:
23
24./manage.py shell
25In [1]: from openvpnathome.apps.openvpn.models import Server, Client
26
27In [2]: Client.objects.create()
28
29... snip ...
30
31OperationalError: no such table: main.openvpn_server__old
32'
33
Back to Top