blog.notmyidea.org/tag/migrations.html

67 lines
No EOL
2.9 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&nbsp;Django</a></h1>
<p>I had to change the primary key of a django model, and I wanted to create a migration for this.
The previous model was using django&nbsp;ids.</p>
<p>The migrations will need to do the following&nbsp;things:</p>
<ul>
<li>Create a new <code>uuid</code> field/column in the&nbsp;database</li>
<li>Iterate over the existing items …</li></ul>
</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>