| 81 | |
| 82 | + when i try to remove the column |
| 83 | {{{ |
| 84 | class PhoneBook(models.Model): |
| 85 | # name = models.CharField(max_length=32, null=True, blank=True, default='jordan') |
| 86 | phone_number = models.CharField(max_length=32, null=True, blank=True) |
| 87 | |
| 88 | |
| 89 | class PhoneBook2(models.Model): |
| 90 | # name = models.CharField(max_length=32, null=True, blank=True, default='jordan') |
| 91 | phone_number = models.CharField(max_length=32, null=True, blank=True) |
| 92 | }}} |
| 93 | |
| 94 | happened like this. |
| 95 | {{{ |
| 96 | In [2]: p=PhoneBook(phone_number='010-1234-1234') |
| 97 | |
| 98 | In [3]: p.save() |
| 99 | INSERT INTO `main_phonebook` (`phone_number`) VALUES (%s) ['010-1234-1234'] |
| 100 | |
| 101 | In [4]: p2=PhoneBook2(phone_number='010-1234-1234') |
| 102 | |
| 103 | In [5]: p2.save() |
| 104 | INSERT INTO `main_phonebook2` (`phone_number`) VALUES (%s) ['010-1234-1234'] |
| 105 | |
| 106 | !!!!!!!!error!!!!!!!!!!!!!!! |
| 107 | IntegrityError: (1364, "Field 'name' doesn't have a default value") |
| 108 | }}} |