Question: I was wondering if it's possible to rename just part of a file name with a node.js script. I'm using node.js with fs. But I can only rename the whole thing.

```
1   const fs = require('fs');
  2 fs.readFile('./test.json', function(error, data) {
  3     if (error) {
  4         console.log(error);
  5         return;
  6     }
  7 
  8     var obj = JSON.parse(data);
  9     for(var p in obj) {
 10         fs.rename('./' + obj[p] + '.jpg', './' + p + '.jpg', function(err) {
 11             if ( err ) console.log('ERROR: ' + err);
 12         });
 13     }
 14 });

```

~ 

and this is my json file

```
1 {
  2         "DEC19" : "2019-12-08",
  3         "MAY19" : "2019-05-26"
  4 }

```

this json file contains only the part of the name that I want to change.

hope you can help me, and thanks (:

Answer: 
Booleans are value types, You need to specify a value for them unless you make a nullable boolean as @StepUp has mentioned. You can read more abouut value types [here](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/value-types)

However if you want to have a default value for `IsExternal` different then zero you can set it in your POCO class

```
public boolean IsExternalLink{ get; set; } = true; // To wahtever default value you choose

```
The code in your question should cause the default constraint to be removed. Are you sure it still exists? It might pay to look at the SQL that is generated when this migration is applied to the database.

With the following migration:

```
migrationBuilder.AddColumn<bool>(
    name: "MyColumn",
    table: "MyTable",
    nullable: false,
    defaultValue: true);

migrationBuilder.AlterColumn<bool>(
    name: "MyColumn",
    table: "MyTable",
    nullable: false,
    defaultValue: null);

```

The following SQL is generated when applying the migration:

```
ALTER TABLE [MyTable] ADD [MyColumn] bit NOT NULL DEFAULT CAST(1 AS bit);

DECLARE @var0 sysname;
      SELECT @var0 = [d].[name]
      FROM [sys].[default_constraints] [d]
      INNER JOIN [sys].[columns] [c] ON [d].[parent_column_id] = [c].[column_id] AND [d].[parent_object_id] = [c].[object_id]
      WHERE ([d].[parent_object_id] = OBJECT_ID(N'[MyTable]') AND [c].[name] = N'MyColumn');
      IF @var0 IS NOT NULL EXEC(N'ALTER TABLE [MyTable] DROP CONSTRAINT [' + @var0 + '];');
      ALTER TABLE [MyTable] ALTER COLUMN [MyColumn] bit NOT NULL;

```

Ever since [this issue](https://github.com/dotnet/efcore/issues/1345) was fixed, default constraints should be removed on each call to AlterColumn. You'll note the majority of that migration SQL is responsible for determining the name of and dropping the default constraint on the `MyColumn` field.