Home → Admin Manual → HelpSpot Hacks → Changing Custom Field Lengths
13.2. Changing Custom Field Lengths
Custom field lengths at the database level are only editable on creation within the user interface. If changes to field size need to be made after creation, these changes must be made at the database level. These instructions are specific to the Text Field type. Note that the following instructions can be destructive (resulting in the truncation of data) if you are reducing field lengths. Because of this, it is recommend to make a database backup before performing these operations.
MySQL
- Change the size of text field in the user interface via the custom field setup area (Admin > Custom Fields)
- Note custom field ID in this interface.
- Access your helpspot database and run this query to change your field size.
// Replace 'Custom1' with the associated ID for your custom field and replace VARCHAR(25) with the appropriate length. ALTER TABLE HS_Request MODIFY Custom1 VARCHAR(25);
SQLServer
- Change the size of text field in the user interface via the custom field setup area (Admin > Custom Fields)
- Note custom field ID in this interface.
- Access your helpspot database and run this query to change your field size.
/****** Drop the current index on the custom field ******/
DROP INDEX [hs_request_custom1_index] ON [dbo].[HS_Request] GO
/****** Alter the column length ******/ ALTER TABLE [dbo].[HS_Request]
ALTER COLUMN [Custom1] [nvarchar](80) NULL
/****** Rebuild index on the custom field ******/ CREATE NONCLUSTERED INDEX [hs_request_custom1_index] ON [dbo].[HS_Request] ( [Custom1] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) GO
This page was: Helpful |
Not Helpful