mirror of
https://github.com/almet/notmyidea.git
synced 2025-04-28 19:42:37 +02:00
71 lines
No EOL
3.1 KiB
HTML
71 lines
No EOL
3.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head>
|
|
<title>
|
|
migrations - Alexis Métaireau </title>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link rel="stylesheet"
|
|
href="https://blog.notmyidea.org/theme/css/main.css?v2"
|
|
type="text/css" />
|
|
<link href="https://blog.notmyidea.org/feeds/all.atom.xml"
|
|
type="application/atom+xml"
|
|
rel="alternate"
|
|
title="Alexis Métaireau ATOM Feed" />
|
|
</head>
|
|
<body>
|
|
<div id="content">
|
|
<section id="links">
|
|
<ul>
|
|
<li>
|
|
<a class="main" href="/">Alexis Métaireau</a>
|
|
</li>
|
|
<li>
|
|
<a class=""
|
|
href="https://blog.notmyidea.org/journal/index.html">Journal</a>
|
|
</li>
|
|
<li>
|
|
<a class=""
|
|
href="https://blog.notmyidea.org/code/">Code, etc.</a>
|
|
</li>
|
|
<li>
|
|
<a class=""
|
|
href="https://blog.notmyidea.org/weeknotes/">Notes hebdo</a>
|
|
</li>
|
|
<li>
|
|
<a class=""
|
|
href="https://blog.notmyidea.org/lectures/">Lectures</a>
|
|
</li>
|
|
<li>
|
|
<a class=""
|
|
href="https://blog.notmyidea.org/projets.html">Projets</a>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<h1>
|
|
Tag « migrations » </h1>
|
|
<section class="section index">
|
|
<time datetime="2024-02-22T00:00:00+01:00">22 février 2024</time> <a class='tag' href="https://blog.notmyidea.org/tag/django.html">django</a>
|
|
, <a class='tag' href="https://blog.notmyidea.org/tag/orm.html">orm</a>
|
|
, <a class='tag' href="https://blog.notmyidea.org/tag/migrations.html">migrations</a>
|
|
<h1>
|
|
<a href="https://blog.notmyidea.org/changing-the-primary-key-of-a-model-in-django.html" id="page-title">Changing the primary key of a model in Django</a>
|
|
</h1>
|
|
<p>I had to change the primary key of a django model, and I wanted to create a
|
|
migration for this.</p>
|
|
<p>The previous model was using django <a href="https://
|
|
docs.djangoproject.com/en/5.0/topics/db/models/#automatic-primary-key-fields">automatic primary key fields</a></p>
|
|
<p>I firstly changed the model to include the new <code>uuid</code> field, and added the <code>id</code>
|
|
field (the old primary key …</p>
|
|
</section>
|
|
<ul>
|
|
</ul>
|
|
</section>
|
|
<footer>
|
|
<a id="feed" href="/feeds/all.atom.xml">
|
|
<img alt="RSS Logo" src="/theme/rss.svg" />
|
|
</a>
|
|
</footer>
|
|
</div>
|
|
</body>
|
|
</html> |