Skip to content

Commit a305746

Browse files
committed
Update sequelize doc links
1 parent 2de9744 commit a305746

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/content/13/es/part13c.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ module.exports = Membership
644644
645645
Así que le hemos dado a la tabla de conexiones un nombre que la describe bien, <i>membership</i>. No siempre hay un nombre relevante para una tabla de conexión, en cuyo caso el nombre de la tabla de conexión puede ser una combinación de los nombres de las tablas que se unen, p. <i>user\_teams</i> podría encajar en nuestra situación.
646646
647-
Realizamos una pequeña adición al archivo <i>models/index.js</i> para conectar equipos y usuarios a nivel de código mediante el método [belongsToMany](https://sequelize.org/master/manual/assocs.html#implementation-3).
647+
Realizamos una pequeña adición al archivo <i>models/index.js</i> para conectar equipos y usuarios a nivel de código mediante el método [belongsToMany](https://sequelize.org/docs/v6/core-concepts/assocs/#implementation-2).
648648
649649
```js
650650
const Note = require('./note')
@@ -1152,7 +1152,7 @@ Por ejemplo, la información podría tener la siguiente forma:
11521152
}
11531153
```
11541154
1155-
Nota: hay varias formas de implementar esta funcionalidad. [Esto](https://sequelize.org/master/manual/advanced-many-to-many.html#the-best-of-both-worlds--the-super-many-to-many-relationship) debería ayuda.
1155+
Nota: hay varias formas de implementar esta funcionalidad. [Esto](https://sequelize.org/docs/v6/advanced-association-concepts/advanced-many-to-many/#the-best-of-both-worlds-the-super-many-to-many-relationship) debería ayuda.
11561156
11571157
Tenga en cuenta también que a pesar de tener un campo de matriz <i>listas de lectura</i> en el ejemplo, siempre debe contener exactamente un objeto, la entrada de la tabla de unión que conecta el libro con la lista de lectura del usuario en particular.
11581158
@@ -1472,7 +1472,7 @@ module.exports = {
14721472
14731473
Sin embargo, el problema es que la definición del modelo puede cambiar con el tiempo, por ejemplo, el campo <i>name</i> puede cambiar o su tipo de datos puede cambiar. Las migraciones deben poder realizarse correctamente en cualquier momento de principio a fin, y si las migraciones dependen del modelo para tener cierto contenido, es posible que ya no sea cierto en un mes o un año. Por lo tanto, a pesar del "copiar y pegar", el código de migración debe estar completamente separado del código del modelo.
14741474
1475-
Una solución sería usar la [herramienta de línea de comandos de Sequelize ](https://sequelize.org/master/manual/migrations.html#creating-the-first-model--and-migration-), que genera modelos y migración archivos basados ​​en comandos dados en la línea de comandos. Por ejemplo, el siguiente comando crearía un modelo <i>Users</i> con <i>name</i>, <i>username</i> y <i>admin</i> como atributos, como así como la migración que gestiona la creación de la tabla de la base de datos:
1475+
Una solución sería usar la [herramienta de línea de comandos de Sequelize ](https://sequelize.org/docs/v6/other-topics/migrations/#creating-the-first-model-and-migration), que genera modelos y migración archivos basados ​​en comandos dados en la línea de comandos. Por ejemplo, el siguiente comando crearía un modelo <i>Users</i> con <i>name</i>, <i>username</i> y <i>admin</i> como atributos, como así como la migración que gestiona la creación de la tabla de la base de datos:
14761476
14771477
```
14781478
npx sequelize-cli model:generate --name User --attributes name:string,username:string,admin:boolean

src/content/13/fi/osa13c.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ module.exports = Membership
639639
640640
Olemme siis antaneet liitostaululle kuvaavan nimen, <i>membership</i>. Liitostauluille ei aina löydy yhtä osuvaa nimeä, tällöin liitostaulun nimi voidaan muodostaa yhdistelmänä liitettävien taulujen nimistä esim. <i>user\_teams</i> voisi sopia tilanteeseemme.
641641
642-
Tiedostoon <i>models/index.js</i> tulee pieni lisäys, joka liittää metodin [belongsToMany](https://sequelize.org/master/manual/assocs.html#implementation-3) avulla tiimit ja käyttäjät toisiinsa myös koodin tasolla.
642+
Tiedostoon <i>models/index.js</i> tulee pieni lisäys, joka liittää metodin [belongsToMany](https://sequelize.org/docs/v6/core-concepts/assocs/#implementation-2) avulla tiimit ja käyttäjät toisiinsa myös koodin tasolla.
643643
644644
```js
645645
const Note = require('./note')
@@ -1151,7 +1151,7 @@ Tieto voi olla esim. seuraavassa muodossa:
11511151
}
11521152
```
11531153
1154-
Huom: tapoja toteuttaa tämä toiminnallisuus on useita. [Tästä](https://sequelize.org/master/manual/advanced-many-to-many.html#the-best-of-both-worlds--the-super-many-to-many-relationship) lienee apua.
1154+
Huom: tapoja toteuttaa tämä toiminnallisuus on useita. [Tästä](https://sequelize.org/docs/v6/advanced-association-concepts/advanced-many-to-many/#the-best-of-both-worlds-the-super-many-to-many-relationship) lienee apua.
11551155
11561156
#### Tehtävä 13.22.
11571157
@@ -1463,7 +1463,7 @@ Emmekö voisi optimoida koodia siten, että esim. model exporttaisi jaetut osat
14631463
14641464
Ongelman muodostaa kuitenkin se, että modelin määritelmä voi muuttua ajan myötä, esimerkiksi kenttä <i>name</i> voi muuttaa nimeä tai sen datatyyppi voi vaihtua. Migraatiot tulee pystyä suorittamaan milloin tahansa onnistuneesti alusta loppuun, ja jos migraatiot luottavat että modelilla on tietty sisältö, ei asia enää välttämättä pidä paikkaansa kuukauden tai vuoden kuluttua. Siispä migraatioiden koodin on syytä olla "copy pastesta" huolimatta täysin erillään modelien koodista.
14651465
1466-
Eräs ratkaisu asiaan olisi Sequelizen [komentorivityökalun](https://sequelize.org/master/manual/migrations.html#creating-the-first-model--and-migration-) käyttö, joka luo sekä modelit että migratiotiedostot komentorivillä annettujen komentojen perusteella. Esim. seuraava komento loisi modelin <i>User</i>, jolla on attribuutteina <i>name</i>, <i>username</i> ja <i>admin</i> sekä tietokantataulun luomisen hoitavan migraation:
1466+
Eräs ratkaisu asiaan olisi Sequelizen [komentorivityökalun](https://sequelize.org/docs/v6/other-topics/migrations/#creating-the-first-model-and-migration) käyttö, joka luo sekä modelit että migratiotiedostot komentorivillä annettujen komentojen perusteella. Esim. seuraava komento loisi modelin <i>User</i>, jolla on attribuutteina <i>name</i>, <i>username</i> ja <i>admin</i> sekä tietokantataulun luomisen hoitavan migraation:
14671467
14681468
```bash
14691469
npx sequelize-cli model:generate --name User --attributes name:string,username:string,admin:boolean

src/content/13/zh/part13c.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -692,8 +692,8 @@ module.exports = Membership
692692
<!-- So we have given the connection table a name that describes it well, <i>membership</i>. There is not always a relevant name for a connection table, in which case the name of the connection table can be a combination of the names of the tables that are joined, e.g. <i>user\_teams</i> could fit our situation.-->
693693
所以我们给连接表起了一个能很好描述它的名字,<i>membership</i>。连接表并不总是有一个相关的名字,在这种情况下,连接表的名字可以是被连接的表的名字的组合,例如,<i>user/_teams</i>可以适合我们的情况。
694694
695-
<!-- We make a small addition to the <i>models/index.js</i> file to connect teams and users at the code level using the [belongsToMany](https://sequelize.org/master/manual/assocs.html#implementation-3) method.-->
696-
我们对<i>models/index.js</i>文件做了一个小小的补充,使用[belongsToMany](https://sequelize.org/master/manual/assocs.html#implementation-3)方法在代码层连接团队和用户。
695+
<!-- We make a small addition to the <i>models/index.js</i> file to connect teams and users at the code level using the [belongsToMany](https://sequelize.org/docs/v6/core-concepts/assocs/#implementation-2) method.-->
696+
我们对<i>models/index.js</i>文件做了一个小小的补充,使用[belongsToMany](https://sequelize.org/docs/v6/core-concepts/assocs/#implementation-2)方法在代码层连接团队和用户。
697697
698698
```js
699699
const Note = require('./note')
@@ -1238,8 +1238,8 @@ router.get('/:id', async (req, res) => {
12381238
}
12391239
```
12401240
1241-
<!-- Note: there are several ways to implement this functionality. [This](https://sequelize.org/master/manual/advanced-many-to-many.html#the-best-of-both-worlds--the-super-many-to-many-relationship) should help.-->
1242-
注意:有几种方法来实现这个功能。[这](https://sequelize.org/master/manual/advanced-many-to-many.html#the-best-of-both-worlds--the-super-many-to-many-relationship)应该有帮助。
1241+
<!-- Note: there are several ways to implement this functionality. [This](https://sequelize.org/docs/v6/advanced-association-concepts/advanced-many-to-many/#the-best-of-both-worlds-the-super-many-to-many-relationship) should help.-->
1242+
注意:有几种方法来实现这个功能。[这](https://sequelize.org/docs/v6/advanced-association-concepts/advanced-many-to-many/#the-best-of-both-worlds-the-super-many-to-many-relationship)应该有帮助。
12431243
12441244
#### Exercise 13.22.
12451245
@@ -1582,8 +1582,8 @@ module.exports = {
15821582
<!-- However, the problem is that the definition of the model may change over time, for example the <i>name</i> field may change or its data type may change. Migrations must be able to be performed successfully at any time from start to end, and if the migrations are relying on the model to have certain content, it may no longer be true in a month or a year's time. Therefore, despite the "copy paste", the migration code should be completely separate from the model code.-->
15831583
然而,问题是,模型的定义可能会随着时间的推移而改变,例如,<i>name</i>字段可能会改变或其数据类型可能会改变。迁移必须能够在任何时候从头到尾成功执行,如果迁移依赖于模型的某些内容,那么在一个月或一年后,它可能不再是真的。因此,尽管有 "复制粘贴",迁移代码应该与模型代码完全分开。
15841584
1585-
<!-- One solution would be to use Sequelize's [command line tool](https://sequelize.org/master/manual/migrations.html#creating-the-first-model--and-migration-), which generates both models and migration files based on commands given at the command line. For example, the following command would create a <i>User</i> model with <i>name</i>, <i>username</i>, and <i>admin</i> as attributes, as well as the migration that manages the creation of the database table:-->
1586-
一个解决方案是使用Sequelize's [命令行工具](https://sequelize.org/master/manual/migrations.html#creating-the-first-model--and-migration-),它可以根据命令行给出的命令来生成模型和迁移文件。例如,下面的命令将创建一个<i>User</i>模型,并将<i>name</i>、<i>username</i>和<i>admin</i>作为属性,以及管理创建数据库表的迁移。
1585+
<!-- One solution would be to use Sequelize's [command line tool](https://sequelize.org/docs/v6/other-topics/migrations/#creating-the-first-model-and-migration), which generates both models and migration files based on commands given at the command line. For example, the following command would create a <i>User</i> model with <i>name</i>, <i>username</i>, and <i>admin</i> as attributes, as well as the migration that manages the creation of the database table:-->
1586+
一个解决方案是使用Sequelize's [命令行工具](https://sequelize.org/docs/v6/other-topics/migrations/#creating-the-first-model-and-migration),它可以根据命令行给出的命令来生成模型和迁移文件。例如,下面的命令将创建一个<i>User</i>模型,并将<i>name</i>、<i>username</i>和<i>admin</i>作为属性,以及管理创建数据库表的迁移。
15871587
15881588
```
15891589
npx sequelize-cli model:generate --name User --attributes name:string,username:string,admin:boolean

0 commit comments

Comments
 (0)