Answers.Body: <p>Don't worry about the UID column. Check out <a href="https://craftcms.stackexchange.com/questions/6599/activerecord-defineattributes#comment7535_6601">this comment from Brad Bell</a>. Craft uses the UID internally, and will add them when needed. You should be fine by leaving them blank.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-02-02T14:34:13.563Z
Answers.LastActivityDate: 2015-02-02T14:34:13.563Z
Answers.LastEditDate: 2017-04-13T12:51:00.200Z
Answers.UserDisplayName: Aaron Berkowitz
Answers.Body: <p>As <a href="https://craftcms.stackexchange.com/a/6923/57">aberkie</a> pointed out, Craft does use them internally, but they should not be left blank or you'll potentially run into some issues now and you'll miss out on some upcoming features.</p>
  
  <p>You can programmatically create one with <a href="http://buildwithcraft.com/classreference/helpers/StringHelper#UUID-detail" rel="nofollow noreferrer">StringHelper::UUID</a> or use a site like <a href="http://www.guidgen.com/" rel="nofollow noreferrer">guidgen.com</a> to get a valid one.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-02-03T04:32:01.497Z
Answers.Text: Thanks Brad, so is there little to no concern about there being duplicate UIDs if using something like guidgen? I've already got all my fields created now (did it manually) but this will be very helpful for future reference.
Answers.UserDisplayName: Christopher Healey
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-02-03T05:48:11.703Z
Answers.Text: Nope... the chances of a proper GUID/UUID conflicting are so astronomical it's not worth worrying about.
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-20T17:11:31.697Z
Answers.Text: If I'm understanding this correctly, does this mean that the `uid` column for any given table row is not used anywhere else to _reference_ that row (unlike columns like `fieldId`, `layoutId`, etc.)?
Answers.UserDisplayName: Sandwich
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-20T17:33:46.487Z
Answers.Text: @Sandwich Within the database itself, UIDs are never used as references in foreign keys; only ID columns. However Craft does use them in a couple places as as an alternative to IDs when selecting rows, and there will be much more liberal use of selecting rows by UID in an upcoming release.
Answers.UserDisplayName: Brandon Kelly
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-02-02T15:58:20.290Z
Answers.LastActivityDate: 2015-02-02T16:27:00.997Z
Answers.LastEditDate: 2017-04-13T12:51:00.303Z
Answers.UserDisplayName: Brad Bell
Body: <p>I have a series of matrix blocks that use a ton of the same fields and was hoping I could simply duplicate them in the database and update the context and id of the fields. It'd be a LOT faster this way however i'm unsure of the UID column, how/when that is created and if i should leave it blank, or if that column existing means i'm going to have to it all manually</p>
  
Tags: <field>
Title: Clarification on UID creation
ThreadText: # Clarification on UID creation
  
  (Asked by: username_0 on 2015-02-02)
  
  I have a series of matrix blocks that use a ton of the same fields and was hoping I could simply duplicate them in the database and update the context and id of the fields. It'd be a LOT faster this way however i'm unsure of the UID column, how/when that is created and if i should leave it blank, or if that column existing means i'm going to have to it all manually
  
  **Tags:** field
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2015-02-02. Score: 6 | Accepted answer
  
  As [aberkie](https://craftcms.stackexchange.com/a/6923/57) pointed out, Craft does use them internally, but they should not be left blank or you'll potentially run into some issues now and you'll miss out on some upcoming features.
  
  You can programmatically create one with [StringHelper::UUID](http://buildwithcraft.com/classreference/helpers/StringHelper#UUID-detail) or use a site like [guidgen.com](http://www.guidgen.com/) to get a valid one.
  
  > **Comments:**
  > **username_0**: Thanks username_2, so is there little to no concern about there being duplicate UIDs if using something like guidgen? I've already got all my fields created now (did it manually) but this will be very helpful for future reference.  
  > **username_2**: Nope... the chances of a proper GUID/UUID conflicting are so astronomical it's not worth worrying about.  
  > **username_3**: If I'm understanding this correctly, does this mean that the `uid` column for any given table row is not used anywhere else to _reference_ that row (unlike columns like `fieldId`, `layoutId`, etc.)?  
  > **username_4**: @username_3 Within the database itself, UIDs are never used as references in foreign keys; only ID columns. However Craft does use them in a couple places as as an alternative to IDs when selecting rows, and there will be much more liberal use of selecting rows by UID in an upcoming release.  
  
  ---
  
  ### Answer by username_1 on 2015-02-02. Score: 0
  
  Don't worry about the UID column. Check out [this comment from username_2 username_2](https://craftcms.stackexchange.com/questions/6599/activerecord-defineattributes#comment7535_6601). Craft uses the UID internally, and will add them when needed. You should be fine by leaving them blank.
  
  
  ---
  
  